diff options
author | David Ahern <dsa@cumulusnetworks.com> | 2016-06-01 21:16:39 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-06-02 18:15:17 -0400 |
commit | b87ab6b8e517563be372b69bdabd96c672458547 (patch) | |
tree | 3a41e76bcbc661afc7181c8d74a90a0fc6a23fe4 /drivers/net/vrf.c | |
parent | 684ff4ef5edd758c47929b852b4ea79be56f8bc0 (diff) | |
download | linux-b87ab6b8e517563be372b69bdabd96c672458547.tar.gz linux-b87ab6b8e517563be372b69bdabd96c672458547.tar.bz2 linux-b87ab6b8e517563be372b69bdabd96c672458547.zip |
net: vrf: set operstate and mtu at link create
The VRF device exists to define L3 domains and guide FIB lookups. As
such its operstate is not relevant. Seeing 'state UNKNOWN' in the
output of 'ip link show' can be confusing, so set operstate at link
create.
Similarly, the MTU for a VRF device is not used; any fragmentation
of the payload is done on the output path based on the real egress
device. An MTU of 1500 on the VRF device while enslaved devices
have a higher MTU can lead to confusion. Since the VRF MTU is not
relevant set to 64k similar to what is done for loopback.
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/vrf.c')
-rw-r--r-- | drivers/net/vrf.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c index dff08842f26d..d356f5d0f7b0 100644 --- a/drivers/net/vrf.c +++ b/drivers/net/vrf.c @@ -504,6 +504,12 @@ static int vrf_dev_init(struct net_device *dev) dev->flags = IFF_MASTER | IFF_NOARP; + /* MTU is irrelevant for VRF device; set to 64k similar to lo */ + dev->mtu = 64 * 1024; + + /* similarly, oper state is irrelevant; set to up to avoid confusion */ + dev->operstate = IF_OPER_UP; + return 0; out_rth: |