Skip to content

Commit

Permalink
[NAT]:Updated natshow script to support DNAT Pool changes (sonic-net#…
Browse files Browse the repository at this point in the history
…1001)

Signed-off-by: Akhilesh Samineni <[email protected]>
  • Loading branch information
AkhileshSamineni authored Oct 8, 2020
1 parent 737c5ad commit efb08f8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/natshow
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class NatShow(object):

ent = self.asic_db.get_all('ASIC_DB', s, blocking=True)

nat_type = ent[b"SAI_NAT_ENTRY_ATTR_NAT_TYPE"]
nat_type = nat['nat_type']

if nat_type == "SAI_NAT_TYPE_DESTINATION_NAT":
translated_dst_ip = ent[b"SAI_NAT_ENTRY_ATTR_DST_IP"]
Expand Down Expand Up @@ -169,6 +169,8 @@ class NatShow(object):
translated_src = translated_src_ip + ":" + translated_src_port
else:
translated_src = translated_src_ip
else:
continue

source_ip = nat['nat_data']['key']["src_ip"]
destination_ip = nat['nat_data']['key']["dst_ip"]
Expand Down

0 comments on commit efb08f8

Please sign in to comment.