Skip to content

fix ipvlan/macvlan link event handing

Hangbin Liu linux-kselftest netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3ipvlan: fix NETDEV_UP/NETDEV_DOWN event handlingdrivers/net/ipvlan/ipvlan_main.c+19 -14 replies
2/3macvlan: fix NETDEV_UP/NETDEV_DOWN event handlingdrivers/net/macvlan.c+20 -00 replies
3/3selftests/rtnetlink.sh: add vlan/ipvlan/macvlan link state testtools/testing/selftests/net/rtnetlink.sh+64 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH net 0/3] fix ipvlan/macvlan link event handing

When setting the lower-layer link up/down, the ipvlan/macvlan device synchronizes its state via netif_stacked_transfer_operstate(), which only checks the carrier state. However, setting the link down does not necessarily change the carrier state for virtual interfaces like bonding. This causes the ipvlan/macvlan state to become out of sync with the lower-layer link state. Fix this by explicitly changing the IFF_UP flag, similar to how VLAN handles it.

Before the patch:

  # ./rtnetlink.sh -t "kci_test_vlan kci_test_ipvlan kci_test_macvlan"
  PASS: vlan link state correct
  FAIL: ipvlan link state incorrect
  FAIL: macvlan link state incorrect

After the patch set:

  # ./rtnetlink.sh -t "kci_test_vlan kci_test_ipvlan kci_test_macvlan"
  PASS: vlan link state correct
  PASS: ipvlan link state correct
  PASS: macvlan link state correct

Hangbin Liu (3):
ipvlan: fix NETDEV_UP/NETDEV_DOWN event handling
macvlan: fix NETDEV_UP/NETDEV_DOWN event handling selftests/rtnetlink.sh: add vlan/ipvlan/macvlan link state test

 drivers/net/ipvlan/ipvlan_main.c         | 20 +++++++-
 drivers/net/macvlan.c                    | 20 ++++++++
 tools/testing/selftests/net/rtnetlink.sh | 64 ++++++++++++++++++++++++
 3 files changed, 103 insertions(+), 1 deletion(-)
Signature · 1 line
2.46.0