Skip to content

Commit 0c87774

Browse files
committed
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.
1 parent e1a3c4a commit 0c87774

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/services/pcn-firewall/src/Firewall.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ Firewall::Firewall(const std::string name, const FirewallJsonObject &conf)
2222
logger()->set_pattern("[%Y-%m-%d %H:%M:%S.%e] [Firewall] [%n] [%l] %v");
2323
logger()->info("Creating Firewall instance");
2424

25-
update(conf);
2625

2726
/*Creating default INGRESS and EGRESS chains.*/
2827
ChainJsonObject chain;
@@ -73,6 +72,8 @@ Firewall::Firewall(const std::string name, const FirewallJsonObject &conf)
7372
egress_programs[ModulesConstants::CONNTRACKTABLEUPDATE] =
7473
new Firewall::ConntrackTableUpdate(ModulesConstants::CONNTRACKTABLEUPDATE,
7574
ChainNameEnum::EGRESS, *this);
75+
76+
update(conf);
7677
}
7778

7879
Firewall::~Firewall() {

0 commit comments

Comments
 (0)