diff options
Diffstat (limited to 'drivers/net/vxlan.c')
| -rw-r--r-- | drivers/net/vxlan.c | 23 | 
1 files changed, 21 insertions, 2 deletions
| diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index 7ac487031b4b..31f4b7911ef8 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c @@ -874,8 +874,8 @@ static int vxlan_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],  static int __vxlan_fdb_delete(struct vxlan_dev *vxlan,  			      const unsigned char *addr, union vxlan_addr ip, -			      __be16 port, __be32 src_vni, u32 vni, u32 ifindex, -			      u16 vid) +			      __be16 port, __be32 src_vni, __be32 vni, +			      u32 ifindex, u16 vid)  {  	struct vxlan_fdb *f;  	struct vxlan_rdst *rd = NULL; @@ -2155,6 +2155,13 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,  		}  		ndst = &rt->dst; +		if (skb_dst(skb)) { +			int mtu = dst_mtu(ndst) - VXLAN_HEADROOM; + +			skb_dst(skb)->ops->update_pmtu(skb_dst(skb), NULL, +						       skb, mtu); +		} +  		tos = ip_tunnel_ecn_encap(tos, old_iph, skb);  		ttl = ttl ? : ip4_dst_hoplimit(&rt->dst);  		err = vxlan_build_skb(skb, ndst, sizeof(struct iphdr), @@ -2190,6 +2197,13 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,  				goto out_unlock;  		} +		if (skb_dst(skb)) { +			int mtu = dst_mtu(ndst) - VXLAN6_HEADROOM; + +			skb_dst(skb)->ops->update_pmtu(skb_dst(skb), NULL, +						       skb, mtu); +		} +  		tos = ip_tunnel_ecn_encap(tos, old_iph, skb);  		ttl = ttl ? : ip6_dst_hoplimit(ndst);  		skb_scrub_packet(skb, xnet); @@ -3103,6 +3117,11 @@ static void vxlan_config_apply(struct net_device *dev,  		max_mtu = lowerdev->mtu - (use_ipv6 ? VXLAN6_HEADROOM :  					   VXLAN_HEADROOM); +		if (max_mtu < ETH_MIN_MTU) +			max_mtu = ETH_MIN_MTU; + +		if (!changelink && !conf->mtu) +			dev->mtu = max_mtu;  	}  	if (dev->mtu > max_mtu) |