--- ethertap.c.old Thu May 4 20:31:21 2000 +++ ethertap.c Wed Jun 21 13:14:18 2000 @@ -29,6 +29,8 @@ #include #include +#define ETHERTAP_MAX_MTU 65536 /* So we can send any IP packet unfragmented */ + /* * Index to functions. */ @@ -39,6 +41,7 @@ static int ethertap_close(struct net_device *dev); static struct net_device_stats *ethertap_get_stats(struct net_device *dev); static void ethertap_rx(struct sock *sk, int len); +static int ethertap_change_mtu(struct net_device *dev, int new_mtu); #ifdef CONFIG_ETHERTAP_MC static void set_multicast_list(struct net_device *dev); #endif @@ -98,6 +101,7 @@ ether_setup(dev); + dev->change_mtu = ethertap_change_mtu; dev->tx_queue_len = 0; dev->flags|=IFF_NOARP; tap_map[dev->base_addr]=dev; @@ -124,6 +128,20 @@ return -ENOBUFS; } netif_start_queue(dev); + return 0; +} + +/* + * Overide default eth_change_mtu handler to allow MTU to be + * larger than 1500 (for example to simulate gigabit ethernet + * Jumbo frames). + */ + +static int ethertap_change_mtu(struct net_device *dev, int new_mtu) +{ + if ((new_mtu < 68) || (new_mtu > ETHERTAP_MAX_MTU)) + return -EINVAL; + dev->mtu = new_mtu; return 0; }