Skip to content

Commit

Permalink
net: vrf: set operstate and mtu at link create
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Ahern authored and David S. Miller committed Jun 2, 2016
1 parent 684ff4e commit b87ab6b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/net/vrf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit b87ab6b

Please sign in to comment.