vrf: prevent adding upper devices
authorSabrina Dubroca <sd@queasysnail.net>
Tue, 26 Mar 2019 17:22:16 +0000 (18:22 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 28 Mar 2019 05:54:38 +0000 (22:54 -0700)
commit1017e0987117c32783ba7c10fe2e7ff1456ba1dc
tree09ef26329b4bbf9519c6359793c56c729d176086
parent23da1021a5736e2412295525154cc58150a34172
vrf: prevent adding upper devices

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
f5426250a6ec ("net: introduce IFF_NO_RX_HANDLER")).

Cc: David Ahern <dsahern@gmail.com>
Fixes: 193125dbd8eb ("net: Introduce VRF device driver")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Acked-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/vrf.c