HomeVyOS Platform

T4897: Fix virtual interface rebuild checks

Description

T4897: Fix virtual interface rebuild checks

leaf_node_changed returns [] (empty list) after a leaf node is
added.

e.g. Setting source-interface doesn't work on an existing vxlan
interface.

Steps to reproduce:

  • Add a vxlan interface without source-address or source-interface options set:
set interfaces vxlan vxlan999 vni 999
set interfaces vxlan vxlan999 remote 192.168.100.100
commit
  • Then set source-address or source-interface:
set interfaces vxlan vxlan999 source-interface eth0
commit

Actual result:

Source address or source-interface are not set:

ip -d link show dev vxlan999
76: vxlan999: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/ether 56:08:ba:4d:4e:a8 brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 65535
    vxlan id 999 remote 192.168.100.100 srcport 0 0 dstport 8472 tos inherit ttl 16 ageing 300 udpcsum noudp6zerocsumtx noudp6zerocsumrx addrgenmode none numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535

Expected result:

77: vxlan999: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/ether 9e:05:d9:58:1a:af brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 65535
    vxlan id 999 remote 192.168.100.100 dev eth0 srcport 0 0 dstport 8472 tos inherit ttl 16 ageing 300 udpcsum noudp6zerocsumtx noudp6zerocsumrx addrgenmode none numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535

All invocations of leaf_node_changed() should be migrated to is_node_changes() if you are only interested in if something changed and don‘t care what exactly changed (content).

Details

Provenance
vfreexAuthored on Dec 29 2022, 7:00 AM
Parents
rVYOSONEX3abec988c44e: pseudo-ethernet: T4391: use is_node_changed() over error prone…
Branches
Loading...
Tags
Loading...