Skip to content

Commit

Permalink
[rfc4292] fix loip mask issue
Browse files Browse the repository at this point in the history
Signed-off-by: Mykola Faryma <[email protected]>
  • Loading branch information
Mykola Faryma committed Jan 31, 2019
1 parent dd9a8ea commit db27b07
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/sonic_ax_impl/mibs/ietf/rfc4292.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ def reinit_data(self):
## Collect only ipv4 lo interfaces
for loopback in loopbacks:
lostr = loopback.decode()
loip = lostr[len("INTF_TABLE:lo:"):]
loipmask = lostr[len("INTF_TABLE:lo:"):]
loip = loipmask.split('/')[0]
ipa = ipaddress.ip_address(loip)
if isinstance(ipa, ipaddress.IPv4Address):
self.loips[loip] = ipa
Expand Down
4 changes: 2 additions & 2 deletions tests/mock_tables/appl_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -675,11 +675,11 @@
"oper_status": "up",
"mtu": "9216"
},
"INTF_TABLE:lo:10.1.0.32": {
"INTF_TABLE:lo:10.1.0.32/32": {
"scope": "global",
"family": "IPv4"
},
"INTF_TABLE:lo:fc00:1::32": {
"INTF_TABLE:lo:fc00:1::32/128": {
"scope": "global",
"family": "IPv6"
}
Expand Down

0 comments on commit db27b07

Please sign in to comment.