OSDN Git Service

vrf: add sysctl parameter for strict mode
authorAndrea Mayer <andrea.mayer@uniroma2.it>
Fri, 19 Jun 2020 22:54:45 +0000 (00:54 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 21 Jun 2020 00:22:22 +0000 (17:22 -0700)
commit33306f1aaf82ba7dd072d4d7b97de63b1033cce3
treef5dcf68fdc17e7c3bf7ce0b8a1204ea0c0a3447c
parentc8baec385737074dad2f792267baa2c134d94ba6
vrf: add sysctl parameter for strict mode

Add net.vrf.strict_mode sysctl parameter.

When net.vrf.strict_mode=0 (default) it is possible to associate multiple
VRF devices to the same table. Conversely, when net.vrf.strict_mode=1 a
table can be associated to a single VRF device.

When switching from net.vrf.strict_mode=0 to net.vrf.strict_mode=1, a check
is performed to verify that all tables have at most one VRF associated,
otherwise the switch is not allowed.

The net.vrf.strict_mode parameter is per network namespace.

Signed-off-by: Andrea Mayer <andrea.mayer@uniroma2.it>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/vrf.c