Commit b6461fe5 authored by gaoxingwang's avatar gaoxingwang Committed by Zheng Zengkai
Browse files

ipvlan: Add handling of NETDEV_UP events

mainline inclusion
from mainline-v5.16-rc5
category: bugfix
commit 57fb346c
bugzilla: https://gitee.com/openeuler/kernel/issues/I4NDLN


CVE: NA

----------------------

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: default avatargaoxingwang <gaoxingwang@huawei.com>
Reviewed-by: default avatarwuchangye <wuchangye@huawei.com>
Reviewed-by: default avatarwuchangye <wuchangye@huawei.com>
Signed-off-by: default avatargaoxingwang <gaoxingwang@huawei.com>
Reviewed-by: default avatarwuchangye <wuchangye@huawei.com>
Reviewed-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 9c5a512a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment