From: Alexander Duyck Date: Tue, 13 Nov 2012 13:10:59 +0000 (+0000) Subject: vxlan: Update hard_header_len based on lowerdev when instantiating VXLAN X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1ba56fb45a927d083f655302e75a1911a75b5da6;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git vxlan: Update hard_header_len based on lowerdev when instantiating VXLAN 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 Acked-by: Stephen Hemminger Signed-off-by: David S. Miller --- diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index 3d0bf664ea35..8b5c61917076 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c @@ -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])