@@ -812,30 +812,11 @@ vti6_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
812812 return err ;
813813}
814814
815- /**
816- * vti6_tnl_change_mtu - change mtu manually for tunnel device
817- * @dev: virtual device associated with tunnel
818- * @new_mtu: the new mtu
819- *
820- * Return:
821- * 0 on success,
822- * %-EINVAL if mtu too small
823- **/
824- static int vti6_change_mtu (struct net_device * dev , int new_mtu )
825- {
826- if (new_mtu < IPV6_MIN_MTU )
827- return - EINVAL ;
828-
829- dev -> mtu = new_mtu ;
830- return 0 ;
831- }
832-
833815static const struct net_device_ops vti6_netdev_ops = {
834816 .ndo_init = vti6_dev_init ,
835817 .ndo_uninit = vti6_dev_uninit ,
836818 .ndo_start_xmit = vti6_tnl_xmit ,
837819 .ndo_do_ioctl = vti6_ioctl ,
838- .ndo_change_mtu = vti6_change_mtu ,
839820 .ndo_get_stats64 = ip_tunnel_get_stats64 ,
840821 .ndo_get_iflink = ip6_tnl_get_iflink ,
841822};
@@ -855,6 +836,8 @@ static void vti6_dev_setup(struct net_device *dev)
855836 dev -> type = ARPHRD_TUNNEL6 ;
856837 dev -> hard_header_len = LL_MAX_HEADER + sizeof (struct ipv6hdr );
857838 dev -> mtu = ETH_DATA_LEN ;
839+ dev -> min_mtu = IPV6_MIN_MTU ;
840+ dev -> max_mtu = IP_MAX_MTU ;
858841 dev -> flags |= IFF_NOARP ;
859842 dev -> addr_len = sizeof (struct in6_addr );
860843 netif_keep_dst (dev );
0 commit comments