diff options
author | Di Zhu <zhudi21@huawei.com> | 2021-07-29 21:19:30 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-07-29 22:17:37 +0100 |
commit | 57fb346cc7d0fc59af70b4650ee10048f61d7b4f (patch) | |
tree | 03f7a8a99f06ad7d3a538ee0222abe0eb45647f9 /drivers/net/ipvlan | |
parent | 3aa2605594556c676fb88744bd9845acae60683d (diff) | |
download | linux-stable-57fb346cc7d0fc59af70b4650ee10048f61d7b4f.tar.gz linux-stable-57fb346cc7d0fc59af70b4650ee10048f61d7b4f.tar.bz2 linux-stable-57fb346cc7d0fc59af70b4650ee10048f61d7b4f.zip |
ipvlan: Add handling of NETDEV_UP events
When an ipvlan device is created on a bond device, the link state
of the ipvlan device may be abnormal. This is because bonding device
allows to add physical network card device in the down state and so
NETDEV_CHANGE event will not be notified to other listeners, so ipvlan
has no chance to update its link status.
The following steps can cause such problems:
1) bond0 is down
2) ip link add link bond0 name ipvlan type ipvlan mode l2
3) echo +enp2s7 >/sys/class/net/bond0/bonding/slaves
4) ip link set bond0 up
After these steps, use ip link command, we found ipvlan has NO-CARRIER:
ipvlan@bond0: <NO-CARRIER, BROADCAST,MULTICAST,UP,M-DOWN> mtu ...>
We can deal with this problem like VLAN: Add handling of NETDEV_UP
events. If we receive NETDEV_UP event, we will update the link status
of the ipvlan.
Signed-off-by: Di Zhu <zhudi21@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ipvlan')
-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 a707502a0c0f..c0b21a5580d5 100644 --- a/drivers/net/ipvlan/ipvlan_main.c +++ b/drivers/net/ipvlan/ipvlan_main.c @@ -732,6 +732,7 @@ static int ipvlan_device_event(struct notifier_block *unused, port = ipvlan_port_get_rtnl(dev); switch (event) { + case NETDEV_UP: case NETDEV_CHANGE: list_for_each_entry(ipvlan, &port->ipvlans, pnode) netif_stacked_transfer_operstate(ipvlan->phy_dev, |