Skip to content

Commit

Permalink
vxlan: Update hard_header_len based on lowerdev when instantiating VXLAN
Browse files Browse the repository at this point in the history
In the event of a VXLAN device being linked to a device that has a
hard_header_len greater than that of standard ethernet we could end up with
the hard_header_len not being large enough for outgoing frames.  In order to
prevent this we should update the length when a lowerdev is provided.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Alexander Duyck authored and David S. Miller committed Nov 13, 2012
1 parent eb5ce43 commit 1ba56fb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/net/vxlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1102,6 +1102,10 @@ static int vxlan_newlink(struct net *net, struct net_device *dev,

if (!tb[IFLA_MTU])
dev->mtu = lowerdev->mtu - VXLAN_HEADROOM;

/* update header length based on lower device */
dev->hard_header_len = lowerdev->hard_header_len +
VXLAN_HEADROOM;
}

if (data[IFLA_VXLAN_TOS])
Expand Down

0 comments on commit 1ba56fb

Please sign in to comment.