diff --git a/Constants.h b/Constants.h index 149a711..cd9e3a2 100644 --- a/Constants.h +++ b/Constants.h @@ -6,4 +6,6 @@ #define MTU_MIN 74 #define MTU_MAX 1522 -#define MTU_DEFAULT 329 \ No newline at end of file +#define MTU_DEFAULT 329 + +#define TXQUEUELEN 10 \ No newline at end of file diff --git a/TAP.c b/TAP.c index 7b5c834..c2be769 100644 --- a/TAP.c +++ b/TAP.c @@ -64,6 +64,22 @@ int open_tap(void) { exit(1); } + // Configure TX queue length + if (ioctl(inet, SIOCGIFTXQLEN, &ifr) < 0) { + perror("Could not get interface flags from kernel"); + close(inet); + cleanup(); + exit(1); + } else { + ifr.ifr_qlen = TXQUEUELEN; + if (ioctl(inet, SIOCSIFTXQLEN, &ifr) < 0) { + perror("Could not set interface TX queue length"); + close(inet); + cleanup(); + exit(1); + } + } + if (!noup) { if (ioctl(inet, SIOCGIFFLAGS, &ifr) < 0) { perror("Could not get interface flags from kernel");