Skip to content

Commit 0f2bbd7

Browse files
authored
Merge pull request sonic-net#97 from mykolaf/fixloip
[rfc4292] fix loip mask issue
2 parents dd9a8ea + db27b07 commit 0f2bbd7

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/sonic_ax_impl/mibs/ietf/rfc4292.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ def reinit_data(self):
3232
## Collect only ipv4 lo interfaces
3333
for loopback in loopbacks:
3434
lostr = loopback.decode()
35-
loip = lostr[len("INTF_TABLE:lo:"):]
35+
loipmask = lostr[len("INTF_TABLE:lo:"):]
36+
loip = loipmask.split('/')[0]
3637
ipa = ipaddress.ip_address(loip)
3738
if isinstance(ipa, ipaddress.IPv4Address):
3839
self.loips[loip] = ipa

tests/mock_tables/appl_db.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -675,11 +675,11 @@
675675
"oper_status": "up",
676676
"mtu": "9216"
677677
},
678-
"INTF_TABLE:lo:10.1.0.32": {
678+
"INTF_TABLE:lo:10.1.0.32/32": {
679679
"scope": "global",
680680
"family": "IPv4"
681681
},
682-
"INTF_TABLE:lo:fc00:1::32": {
682+
"INTF_TABLE:lo:fc00:1::32/128": {
683683
"scope": "global",
684684
"family": "IPv6"
685685
}

0 commit comments

Comments
 (0)