From 0c87774c82a7cc8e3c5c31b1f10182197892deb6 Mon Sep 17 00:00:00 2001 From: Jianwen Pi Date: Mon, 16 Dec 2019 11:07:48 -0800 Subject: [PATCH] Adjust the init order when creating firewall cube object so the parameter passed by user can be populated, the will also avoid the crash due to object reference before object initialization. --- src/services/pcn-firewall/src/Firewall.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/services/pcn-firewall/src/Firewall.cpp b/src/services/pcn-firewall/src/Firewall.cpp index e5331b92a..cd8d01098 100644 --- a/src/services/pcn-firewall/src/Firewall.cpp +++ b/src/services/pcn-firewall/src/Firewall.cpp @@ -22,7 +22,6 @@ Firewall::Firewall(const std::string name, const FirewallJsonObject &conf) logger()->set_pattern("[%Y-%m-%d %H:%M:%S.%e] [Firewall] [%n] [%l] %v"); logger()->info("Creating Firewall instance"); - update(conf); /*Creating default INGRESS and EGRESS chains.*/ ChainJsonObject chain; @@ -73,6 +72,8 @@ Firewall::Firewall(const std::string name, const FirewallJsonObject &conf) egress_programs[ModulesConstants::CONNTRACKTABLEUPDATE] = new Firewall::ConntrackTableUpdate(ModulesConstants::CONNTRACKTABLEUPDATE, ChainNameEnum::EGRESS, *this); + + update(conf); } Firewall::~Firewall() {