diff options
author | Venkat Venkatsubra <venkat.x.venkatsubra@oracle.com> | 2024-04-05 11:16:12 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2024-04-08 13:20:01 +0100 |
commit | 229783970838887e72083820efb9270b7f276a11 (patch) | |
tree | 7ff370a894b05328ac599df51dba624461bfbf3c /drivers/net/ipvlan/ipvlan_main.c | |
parent | 86d43e2bf93ccac88ef71cee36a23282ebd9e427 (diff) | |
download | linux-229783970838887e72083820efb9270b7f276a11.tar.gz linux-229783970838887e72083820efb9270b7f276a11.tar.bz2 linux-229783970838887e72083820efb9270b7f276a11.zip |
ipvlan: handle NETDEV_DOWN event
In case of stacked devices, to help propagate the down
link state from the parent/root device (to this leaf device),
handle NETDEV_DOWN event like it is done now for NETDEV_UP.
In the below example, ens5 is the host interface which is the
parent of the ipvlan interface eth0 in the container.
Host:
[root@gkn-podman-x64 ~]# ip link set ens5 down
[root@gkn-podman-x64 ~]# ip -d link show dev ens5
3: ens5: <BROADCAST,MULTICAST> mtu 9000 qdisc mq state DOWN
...
[root@gkn-podman-x64 ~]#
Container:
[root@testnode-ol8 /]# ip -d link show dev eth0
2: eth0@if3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 state UNKNOWN
...
ipvlan mode l2 bridge
...
[root@testnode-ol8 /]#
eth0's state continues to show up as UP even though ens5 is now DOWN.
For macvlan the handling of NETDEV_DOWN event was added in
commit 80fd2d6ca546 ("macvlan: Change status when lower device goes down").
Reported-by: Gia-Khanh Nguyen <gia-khanh.nguyen@oracle.com>
Signed-off-by: Venkat Venkatsubra <venkat.x.venkatsubra@oracle.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ipvlan/ipvlan_main.c')
-rw-r--r-- | drivers/net/ipvlan/ipvlan_main.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c index 5920f7e63352..094f44dac5c8 100644 --- a/drivers/net/ipvlan/ipvlan_main.c +++ b/drivers/net/ipvlan/ipvlan_main.c @@ -735,6 +735,7 @@ static int ipvlan_device_event(struct notifier_block *unused, switch (event) { case NETDEV_UP: + case NETDEV_DOWN: case NETDEV_CHANGE: list_for_each_entry(ipvlan, &port->ipvlans, pnode) netif_stacked_transfer_operstate(ipvlan->phy_dev, |