Skip to content

Commit efb08f8

Browse files
[NAT]:Updated natshow script to support DNAT Pool changes (sonic-net#1001)
Signed-off-by: Akhilesh Samineni <[email protected]>
1 parent 737c5ad commit efb08f8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

scripts/natshow

+3-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ class NatShow(object):
139139

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

142-
nat_type = ent[b"SAI_NAT_ENTRY_ATTR_NAT_TYPE"]
142+
nat_type = nat['nat_type']
143143

144144
if nat_type == "SAI_NAT_TYPE_DESTINATION_NAT":
145145
translated_dst_ip = ent[b"SAI_NAT_ENTRY_ATTR_DST_IP"]
@@ -169,6 +169,8 @@ class NatShow(object):
169169
translated_src = translated_src_ip + ":" + translated_src_port
170170
else:
171171
translated_src = translated_src_ip
172+
else:
173+
continue
172174

173175
source_ip = nat['nat_data']['key']["src_ip"]
174176
destination_ip = nat['nat_data']['key']["dst_ip"]

0 commit comments

Comments
 (0)