diff --git a/src/sonic_ax_impl/mibs/ietf/rfc4292.py b/src/sonic_ax_impl/mibs/ietf/rfc4292.py index 487d14855d91..a07c7159d5da 100644 --- a/src/sonic_ax_impl/mibs/ietf/rfc4292.py +++ b/src/sonic_ax_impl/mibs/ietf/rfc4292.py @@ -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 diff --git a/tests/mock_tables/appl_db.json b/tests/mock_tables/appl_db.json index 2bbdf915ce1f..646e081042d9 100644 --- a/tests/mock_tables/appl_db.json +++ b/tests/mock_tables/appl_db.json @@ -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" }