* PATCH: 2.4.37.9 MTU change for TUN/TAP interfaces
@ 2010-04-07 19:57 Sylvain Rochet
2010-04-20 5:03 ` Willy Tarreau
0 siblings, 1 reply; 2+ messages in thread
From: Sylvain Rochet @ 2010-04-07 19:57 UTC (permalink / raw)
To: linux-kernel
[-- Attachment #1.1: Type: text/plain, Size: 133 bytes --]
Hi,
This patch add the ability to change the MTU of TUN/TAP interfaces for
the 2.4.x kernels series.
Best regards,
Sylvain
[-- Attachment #1.2: tuntap-change-mtu-2.4.37.9.patch --]
[-- Type: text/x-diff, Size: 721 bytes --]
diff -Nru linux-2.4.36.6.a/drivers/net/tun.c linux-2.4.36.6.b/drivers/net/tun.c
--- linux-2.4.36.6.a/drivers/net/tun.c 2008-06-06 18:25:34.000000000 +0200
+++ linux-2.4.36.6.b/drivers/net/tun.c 2010-04-07 17:51:33.000000000 +0200
@@ -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;
}
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: PATCH: 2.4.37.9 MTU change for TUN/TAP interfaces
2010-04-07 19:57 PATCH: 2.4.37.9 MTU change for TUN/TAP interfaces Sylvain Rochet
@ 2010-04-20 5:03 ` Willy Tarreau
0 siblings, 0 replies; 2+ messages in thread
From: Willy Tarreau @ 2010-04-20 5:03 UTC (permalink / raw)
To: Sylvain Rochet; +Cc: linux-kernel
Hello Sylvain,
On Wed, Apr 07, 2010 at 09:57:24PM +0200, Sylvain Rochet wrote:
> 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-04-20 5:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-07 19:57 PATCH: 2.4.37.9 MTU change for TUN/TAP interfaces Sylvain Rochet
2010-04-20 5:03 ` Willy Tarreau
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox