Skip to content

Commit

Permalink
Merge pull request sonic-net#97 from mykolaf/fixloip
Browse files Browse the repository at this point in the history
[rfc4292] fix loip mask issue
  • Loading branch information
yxieca authored Jan 31, 2019
2 parents dd9a8ea + db27b07 commit 0f2bbd7
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 0f2bbd7

Please sign in to comment.