Skip to content

Commit

Permalink
Fixes for NAT lgtm alerts (sonic-net#1320)
Browse files Browse the repository at this point in the history
  • Loading branch information
AkhileshSamineni authored Jun 17, 2020
1 parent 13fca3a commit 0784502
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cfgmgr/natmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3936,7 +3936,7 @@ void NatMgr::setDynamicAllForwardOrAclbasedRules(const string &opCmd, const stri
/* After deletion, set acl_interface to None */
if (opCmd == DELETE)
{
m_natBindingInfo[dynamicKey].acl_interface == NONE_STRING;
m_natBindingInfo[dynamicKey].acl_interface = NONE_STRING;
}
}

Expand Down
8 changes: 8 additions & 0 deletions natsyncd/natsync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ NatSync::NatSync(RedisPipeline *pipelineAppDB, DBConnector *appDb, DBConnector *
}
}

NatSync::~NatSync()
{
if (m_AppRestartAssist)
{
delete m_AppRestartAssist;
}
}

/* To check the port init is done or not */
bool NatSync::isPortInitDone(DBConnector *app_db)
{
Expand Down
1 change: 1 addition & 0 deletions natsyncd/natsync.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class NatSync : public NetMsg
{
public:
NatSync(RedisPipeline *pipelineAppDB, DBConnector *appDb, DBConnector *stateDb, NfNetlink *nfnl);
~NatSync();

virtual void onMsg(int nlmsg_type, struct nl_object *obj);

Expand Down
2 changes: 1 addition & 1 deletion tests/test_nat.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def test_DelNatStaticEntry(self, dvs, testlog):
self.app_db.wait_for_n_keys("NAT_TABLE", 0)

#check the entry is not there in asic db
keys = self.asic_db.wait_for_n_keys("ASIC_STATE:SAI_OBJECT_TYPE_NAT_ENTRY", 0)
self.asic_db.wait_for_n_keys("ASIC_STATE:SAI_OBJECT_TYPE_NAT_ENTRY", 0)

def test_AddNaPtStaticEntry(self, dvs, testlog):
# initialize
Expand Down

0 comments on commit 0784502

Please sign in to comment.