PATCH: 2.4.37.9 MTU change for TUN/TAP interfaces
Subsystems (2)
Hi,
This patch add the ability to change the MTU of TUN/TAP interfaces for the 2.4.x kernels series.
Best regards,
Sylvain
drivers/net/tun.c +12 -0
@@ -118,6 +118,17 @@return &tun->stats; } +#define MIN_MTU 68 +#define MAX_MTU 65535 + +static int tun_net_change_mtu (struct net_device *dev,int new_mtu) { +if (new_mtu <MIN_MTU || new_mtu + dev->hard_header_len >MAX_MTU ) +return -EINVAL ; + dev->mtu = new_mtu; +return 0 ; +} + +/* Initialize net device. */ int tun_net_init (struct net_device *dev) {
@@ -156,6 +167,7 @@break ; }; + dev->change_mtu = tun_net_change_mtu;return 0 ; }
Hello Sylvain,
Quoted 4 lines · Sylvain Rochet
Hi,
This patch add the ability to change the MTU of TUN/TAP interfaces for the 2.4.x kernels series.
I never noticed it was not possible to change the MTU on TUN devices, and you seem to be the first one to report it !
Well, considering that 2.6 already supports this and that the change is obvious, I'm OK to merge it.
Thanks,
Willy