Skip to content

Commit

Permalink
Skip unnumbered BGP neighbors instead of failing
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas Stockner <[email protected]>
  • Loading branch information
lukasstockner committed Nov 10, 2022
1 parent 8a515f2 commit 863d26d
Showing 1 changed file with 7 additions and 1 deletion.
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 863d26d

Please sign in to comment.