aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXin Long <lucien.xin@gmail.com>2018-02-27 06:19:41 -0500
committerDavid S. Miller <davem@davemloft.net>2018-02-27 14:36:28 -0500
commit2b3957c34b6d7f03544b12ebbf875eee430745db (patch)
treed7002ce7bf34de3ee2372a09e271c42f4df8a033
parenta6aa80446234ec0ad38eecdb8efc59e91daae565 (diff)
sit: fix IFLA_MTU ignored on NEWLINK
Commit 128bb975dc3c ("ip6_gre: init dev->mtu and dev->hard_header_len correctly") fixed IFLA_MTU ignored on NEWLINK for ip6_gre. The same mtu fix is also needed for sit. Note that dev->hard_header_len setting for sit works fine, no need to fix it. sit is actually ipv4 tunnel, it can't call ip6_tnl_change_mtu to set mtu. Reported-by: Jianlin Shi <jishi@redhat.com> Signed-off-by: Xin Long <lucien.xin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/ipv6/sit.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index 3a1775a62973..0195598f7bb5 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -1578,6 +1578,13 @@ static int ipip6_newlink(struct net *src_net, struct net_device *dev,
1578 if (err < 0) 1578 if (err < 0)
1579 return err; 1579 return err;
1580 1580
1581 if (tb[IFLA_MTU]) {
1582 u32 mtu = nla_get_u32(tb[IFLA_MTU]);
1583
1584 if (mtu >= IPV6_MIN_MTU && mtu <= 0xFFF8 - dev->hard_header_len)
1585 dev->mtu = mtu;
1586 }
1587
1581#ifdef CONFIG_IPV6_SIT_6RD 1588#ifdef CONFIG_IPV6_SIT_6RD
1582 if (ipip6_netlink_6rd_parms(data, &ip6rd)) 1589 if (ipip6_netlink_6rd_parms(data, &ip6rd))
1583 err = ipip6_tunnel_update_6rd(nt, &ip6rd); 1590 err = ipip6_tunnel_update_6rd(nt, &ip6rd);