Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d443ed2

Browse files
committedNov 25, 2024··
Merge 'a1e11f8' and '7a88058' into 202305
a1e11f8: Don't report VLAN interfacesas oper_down 7a88058: Skip unnumbered BGP neighbors instead of failing Signed-off-by: Xavier Moffett <sapphirus@azorium.net>
2 parents 6f59d29 + a1e11f8 commit d443ed2

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed
 

‎src/sonic_ax_impl/mibs/ietf/rfc1213.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,12 @@ def get_oper_status(self, sub_id):
530530
:param sub_id: The 1-based sub-identifier query.
531531
:return: oper state value for the respective sub_id.
532532
"""
533-
return self._get_status(sub_id, "oper_status")
533+
if self.get_oid(sub_id) in self.vlan_oid_name_map:
534+
# VLAN interfaces don't have an operational status, so return admin status for them
535+
key = "admin_status"
536+
else:
537+
key = "oper_status"
538+
return self._get_status(sub_id, key)
534539

535540
def get_mtu(self, sub_id):
536541
"""

‎src/sonic_ax_impl/mibs/vendor/cisco/bgp4.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,13 @@ def update_data(self):
3939
neigh_info = self.db_conn[db_index].get_all(mibs.STATE_DB, neigh_key, blocking=False)
4040
if neigh_info:
4141
state = neigh_info['state']
42-
ip = ipaddress.ip_address(neigh_str)
42+
try:
43+
ip = ipaddress.ip_address(neigh_str)
44+
except ValueError:
45+
# In case of unnumbered BGP, the neighbor is an interface.
46+
# That can't be represented here, so just skip the neighbor.
47+
continue
48+
4349
if type(ip) is ipaddress.IPv4Address:
4450
oid_head = (1, 4)
4551
else:

0 commit comments

Comments
 (0)
Please sign in to comment.