Skip to content

Commit 50ce7b1

Browse files
committed
Revert too-aggressive optimization introduced in #2575
Fixes #2583
1 parent 1719cd0 commit 50ce7b1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

netsim/modules/bgp.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ def build_ibgp_sessions(node: Box, sessions: Box, topology: Box) -> None:
181181
node_as = node.bgp['as'] # Set up variables that will come handy, starting with node AS
182182
is_rr = node.bgp.get("rr",None) # Is this node an RR?
183183
bgp_nhs = node.bgp.get("next_hop_self",None) # Do we have to set next hop on IBGP sessions?
184+
has_ibgp = False # Assume we have no IBGP sessions (yet)
184185
rrlist = [] if is_rr else find_bgp_rr(node_as,topology)
185186

186187
if is_rr or not rrlist: # If the current node is RR or we have a full mesh
@@ -202,8 +203,9 @@ def build_ibgp_sessions(node: Box, sessions: Box, topology: Box) -> None:
202203
if is_rr and not 'rr' in neighbor_data:
203204
neighbor_data.rr_client = True
204205
node.bgp.neighbors.append(neighbor_data)
206+
has_ibgp = True
205207

206-
if not ibgp_ngb_list:
208+
if not has_ibgp:
207209
return
208210

209211
# Do we have to warn the user that IBGP sessions work better with IGP?

0 commit comments

Comments
 (0)