Skip to content

Commit

Permalink
Be careful when fetching 'parentindex' from a VLAN interface (fixes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
ipspace committed Feb 8, 2025
1 parent 830725f commit 6e2ee05
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 1 addition & 1 deletion netsim/modules/vlan.py
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,7 @@ def rename_vlan_subinterfaces(node: Box, topology: Box) -> None:
remove_vlan_from_trunk(parent_intf,intf.vlan.access_id)

if has_vlan_loopbacks:
node.interfaces = [ intf for intf in node.interfaces if intf.parentindex != 'loopback']
node.interfaces = [ intf for intf in node.interfaces if intf.get('parentindex',None) != 'loopback']

"""
If we have a routed native VLAN, and there are no other bridged VLANs left
Expand Down
3 changes: 0 additions & 3 deletions tests/topology/expected/vxlan-router-stick.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ nodes:
- ifname: Ethernet3
ipv4: 10.1.0.6/30
node: s2
parentindex: {}
type: p2p
- bridge_group: 1
ifindex: 40000
Expand All @@ -227,7 +226,6 @@ nodes:
- ifname: Vlan1000
ipv4: 172.16.0.3/24
node: r1
parentindex: {}
type: svi
virtual_interface: true
vlan:
Expand All @@ -247,7 +245,6 @@ nodes:
- ifname: Vlan1001
ipv4: 172.16.1.3/24
node: r1
parentindex: {}
type: svi
virtual_interface: true
vlan:
Expand Down

0 comments on commit 6e2ee05

Please sign in to comment.