From 49fb9cfe37259eb878ac0cb62eed3c80e9869900 Mon Sep 17 00:00:00 2001 From: Claudio-Daniel Freire Date: Wed, 3 Aug 2011 12:31:22 +0200 Subject: [PATCH] Set TUN/TAP devices to ONE_QUEUE mode, which is more stable. Otherwise, heavily-loaded tunnels can destabilize PlanetLab kernels. --- src/nepi/testbeds/planetlab/scripts/tunalloc.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/nepi/testbeds/planetlab/scripts/tunalloc.c b/src/nepi/testbeds/planetlab/scripts/tunalloc.c index 6adcf24a..9101392a 100644 --- a/src/nepi/testbeds/planetlab/scripts/tunalloc.c +++ b/src/nepi/testbeds/planetlab/scripts/tunalloc.c @@ -11,7 +11,11 @@ #include #include #include +#include #include +#include +#include +#include #include #include @@ -91,5 +95,13 @@ int tun_alloc(int iftype, char *if_name) } remotefd = receive_vif_fd(control_fd, if_name); + + /* set "safe" (non-breaking) queueing mode IFF_ONE_QUEUE */ + struct ifreq ifr; + if (0 == fcntl(remotefd, TUNGETIFF, &ifr)) { + ifr.ifr_flags |= IFF_ONE_QUEUE; + fcntl(remotefd, TUNSETIFF, &ifr); + } + return remotefd; } -- 2.47.0