Skip to content

Commit

Permalink
Solution to bug #352
Browse files Browse the repository at this point in the history
  • Loading branch information
pinoOgni committed Jul 5, 2021
1 parent 5ba31a1 commit 77213c3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/services/pcn-nat/src/Nat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ std::shared_ptr<Rule> Nat::getRule() {
}

void Nat::addRule(const RuleJsonObject &value) {
logger()->info("Adding rule");
rule_ = std::make_shared<Rule>(*this, value);
}

Expand All @@ -150,7 +151,11 @@ void Nat::replaceRule(const RuleJsonObject &conf) {
}

void Nat::delRule() {
rule_ = nullptr;
rule_ = nullptr; //In this way we can call the destroyers of the rules Snat, Dnat, Port-Forwarding
// We need an "empty" rule_ like the one created at initialization in the constructor.
// Otherwise there is an error in the display of the nat after the deletion. As in issue #352
RuleJsonObject empty_rule;
rule_ = std::make_shared<Rule>(*this, empty_rule);
}

std::shared_ptr<NattingTable> Nat::getNattingTable(
Expand Down

0 comments on commit 77213c3

Please sign in to comment.