mirror of
https://github.com/markqvist/tncattach.git
synced 2026-06-10 10:05:59 -04:00
Implemented setting txqueuelen on created interface
This commit is contained in:
+3
-1
@@ -6,4 +6,6 @@
|
||||
|
||||
#define MTU_MIN 74
|
||||
#define MTU_MAX 1522
|
||||
#define MTU_DEFAULT 329
|
||||
#define MTU_DEFAULT 329
|
||||
|
||||
#define TXQUEUELEN 10
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user