Skip to content

Commit

Permalink
Merge 'a1e11f8' and '7a88058' into 202305
Browse files Browse the repository at this point in the history
a1e11f8: Don't report VLAN interfacesas oper_down
7a88058: Skip unnumbered BGP neighbors instead of failing

Signed-off-by: Xavier Moffett <[email protected]>
  • Loading branch information
SapphirusBeryl committed Nov 25, 2024
2 parents 6f59d29 + a1e11f8 commit d443ed2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/sonic_ax_impl/mibs/ietf/rfc1213.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,12 @@ def get_oper_status(self, sub_id):
:param sub_id: The 1-based sub-identifier query.
:return: oper state value for the respective sub_id.
"""
return self._get_status(sub_id, "oper_status")
if self.get_oid(sub_id) in self.vlan_oid_name_map:
# VLAN interfaces don't have an operational status, so return admin status for them
key = "admin_status"
else:
key = "oper_status"
return self._get_status(sub_id, key)

def get_mtu(self, sub_id):
"""
Expand Down
8 changes: 7 additions & 1 deletion src/sonic_ax_impl/mibs/vendor/cisco/bgp4.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,13 @@ def update_data(self):
neigh_info = self.db_conn[db_index].get_all(mibs.STATE_DB, neigh_key, blocking=False)
if neigh_info:
state = neigh_info['state']
ip = ipaddress.ip_address(neigh_str)
try:
ip = ipaddress.ip_address(neigh_str)
except ValueError:
# In case of unnumbered BGP, the neighbor is an interface.
# That can't be represented here, so just skip the neighbor.
continue

if type(ip) is ipaddress.IPv4Address:
oid_head = (1, 4)
else:
Expand Down

0 comments on commit d443ed2

Please sign in to comment.