Implemented setting txqueuelen on created interface
This commit is contained in:
parent
e7a831b41d
commit
b438e5fb5a
|
@ -6,4 +6,6 @@
|
|||
|
||||
#define MTU_MIN 74
|
||||
#define MTU_MAX 1522
|
||||
#define MTU_DEFAULT 329
|
||||
#define MTU_DEFAULT 329
|
||||
|
||||
#define TXQUEUELEN 10
|
16
TAP.c
16
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");
|
||||
|
|
Loading…
Reference in New Issue