提交 043c7f11 编写于 作者: S Sabrina Dubroca 提交者: Xie XiuQi

vrf: prevent adding upper devices

[ Upstream commit 1017e098 ]

VRF devices don't work with upper devices. Currently, it's possible to
add a VRF device to a bridge or team, and to create macvlan, macsec, or
ipvlan devices on top of a VRF (bond and vlan are prevented respectively
by the lack of an ndo_set_mac_address op and the NETIF_F_VLAN_CHALLENGED
feature flag).

Fix this by setting the IFF_NO_RX_HANDLER flag (introduced in commit
f5426250 ("net: introduce IFF_NO_RX_HANDLER")).

Cc: David Ahern <dsahern@gmail.com>
Fixes: 193125db ("net: Introduce VRF device driver")
Signed-off-by: NSabrina Dubroca <sd@queasysnail.net>
Acked-by: NDavid Ahern <dsahern@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Conflicts:
    drivers/net/vrf.c
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 3205bc2b
...@@ -1272,6 +1272,7 @@ static void vrf_setup(struct net_device *dev) ...@@ -1272,6 +1272,7 @@ static void vrf_setup(struct net_device *dev)
/* default to no qdisc; user can add if desired */ /* default to no qdisc; user can add if desired */
dev->priv_flags |= IFF_NO_QUEUE; dev->priv_flags |= IFF_NO_QUEUE;
dev->priv_flags |= IFF_NO_RX_HANDLER;
dev->min_mtu = 0; dev->min_mtu = 0;
dev->max_mtu = 0; dev->max_mtu = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册