Skip to content

Commit

Permalink
Merge pull request #1751 from jtishey/ios_bgp_duplicate_neighbor
Browse files Browse the repository at this point in the history
IOS get_bgp_neighbors same IP different VRF - Fix #1497 #1231
  • Loading branch information
mirceaulinic authored Mar 21, 2024
2 parents 3d411b0 + 98a87e3 commit 077be75
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions napalm/ios/ios.py
Original file line number Diff line number Diff line change
Expand Up @@ -1957,12 +1957,17 @@ def get_bgp_neighbors(self):
# get neighbor_entry out of neighbor data
neighbor_entry = None
for neighbor in neighbor_data:
if (
neighbor["afi"].lower() == afi
and napalm.base.helpers.ip(neighbor["remote_addr"]) == remote_addr
):
neighbor_entry = neighbor
break
current_neighbor = napalm.base.helpers.ip(neighbor["remote_addr"])
if neighbor["afi"].lower() == afi and current_neighbor == remote_addr:
# Neighbor IPs in VRFs can overlap, so make sure
# we haven't covered this VRF + IP already
vrf = neighbor["vrf"] or "global"
if (
vrf == "global"
or current_neighbor not in bgp_neighbor_data[vrf]["peers"]
):
neighbor_entry = neighbor
break
# check for proper session data for the afi
if neighbor_entry is None:
continue
Expand Down

0 comments on commit 077be75

Please sign in to comment.