]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - net/ipv6/sit.c
netfilter: x_tables: pass xt_counters struct instead of packet counter
[mirror_ubuntu-bionic-kernel.git] / net / ipv6 / sit.c
index b1cdf8009d29c4a36a9c7f3f545930134b0d51d5..0355231162b85e58c2ccf01af598c1e94cf629c8 100644 (file)
@@ -76,7 +76,7 @@ static bool check_6rd(struct ip_tunnel *tunnel, const struct in6_addr *v6dst,
                      __be32 *v4dst);
 static struct rtnl_link_ops sit_link_ops __read_mostly;
 
-static int sit_net_id __read_mostly;
+static unsigned int sit_net_id __read_mostly;
 struct sit_net {
        struct ip_tunnel __rcu *tunnels_r_l[IP6_SIT_HASH_SIZE];
        struct ip_tunnel __rcu *tunnels_r[IP6_SIT_HASH_SIZE];
@@ -1318,23 +1318,11 @@ done:
        return err;
 }
 
-static int ipip6_tunnel_change_mtu(struct net_device *dev, int new_mtu)
-{
-       struct ip_tunnel *tunnel = netdev_priv(dev);
-       int t_hlen = tunnel->hlen + sizeof(struct iphdr);
-
-       if (new_mtu < IPV6_MIN_MTU || new_mtu > 0xFFF8 - t_hlen)
-               return -EINVAL;
-       dev->mtu = new_mtu;
-       return 0;
-}
-
 static const struct net_device_ops ipip6_netdev_ops = {
        .ndo_init       = ipip6_tunnel_init,
        .ndo_uninit     = ipip6_tunnel_uninit,
        .ndo_start_xmit = sit_tunnel_xmit,
        .ndo_do_ioctl   = ipip6_tunnel_ioctl,
-       .ndo_change_mtu = ipip6_tunnel_change_mtu,
        .ndo_get_stats64 = ip_tunnel_get_stats64,
        .ndo_get_iflink = ip_tunnel_get_iflink,
 };
@@ -1365,6 +1353,8 @@ static void ipip6_tunnel_setup(struct net_device *dev)
        dev->type               = ARPHRD_SIT;
        dev->hard_header_len    = LL_MAX_HEADER + t_hlen;
        dev->mtu                = ETH_DATA_LEN - t_hlen;
+       dev->min_mtu            = IPV6_MIN_MTU;
+       dev->max_mtu            = 0xFFF8 - t_hlen;
        dev->flags              = IFF_NOARP;
        netif_keep_dst(dev);
        dev->addr_len           = 4;