diff options
author | 2018-07-25 10:21:19 -0400 | |
---|---|---|
committer | 2018-07-25 10:21:19 -0400 | |
commit | b78cc5869307ddb93a7b1795af992356a54d1d21 (patch) | |
tree | 025fa10749d4e5c0cf29805ecde5698a59ef3d41 /src/fnet/main.c | |
parent | Add profile for patch and shellcheck (diff) | |
download | firejail-b78cc5869307ddb93a7b1795af992356a54d1d21.tar.gz firejail-b78cc5869307ddb93a7b1795af992356a54d1d21.tar.zst firejail-b78cc5869307ddb93a7b1795af992356a54d1d21.zip |
fix --net=wlan
Diffstat (limited to 'src/fnet/main.c')
-rw-r--r-- | src/fnet/main.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/fnet/main.c b/src/fnet/main.c index 5be15bc75..ec8b2cade 100644 --- a/src/fnet/main.c +++ b/src/fnet/main.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include "fnet.h" | 20 | #include "fnet.h" |
21 | #include <sys/types.h> | 21 | #include <sys/types.h> |
22 | #include <sys/stat.h> | 22 | #include <sys/stat.h> |
23 | #include <sys/utsname.h> | ||
23 | 24 | ||
24 | int arg_quiet = 0; | 25 | int arg_quiet = 0; |
25 | 26 | ||
@@ -91,10 +92,7 @@ printf("\n"); | |||
91 | else if (argc == 6 && strcmp(argv[1], "create") == 0 && strcmp(argv[2], "macvlan") == 0) { | 92 | else if (argc == 6 && strcmp(argv[1], "create") == 0 && strcmp(argv[2], "macvlan") == 0) { |
92 | // use ipvlan for wireless devices | 93 | // use ipvlan for wireless devices |
93 | // ipvlan driver was introduced in Linux kernel 3.19 | 94 | // ipvlan driver was introduced in Linux kernel 3.19 |
94 | // detect both compile time and run time | 95 | |
95 | #ifndef IPVLAN_MODE_L2 // compile time | ||
96 | net_create_macvlan(argv[3], argv[4], atoi(argv[5])); | ||
97 | #else | ||
98 | // check kernel version | 96 | // check kernel version |
99 | struct utsname u; | 97 | struct utsname u; |
100 | int rv = uname(&u); | 98 | int rv = uname(&u); |
@@ -107,8 +105,6 @@ printf("\n"); | |||
107 | exit(1); | 105 | exit(1); |
108 | } | 106 | } |
109 | 107 | ||
110 | if (arg_debug) | ||
111 | printf("Linux kernel version %d.%d\n", major, minor); | ||
112 | if (major <= 3 && minor < 18) | 108 | if (major <= 3 && minor < 18) |
113 | net_create_macvlan(argv[3], argv[4], atoi(argv[5])); | 109 | net_create_macvlan(argv[3], argv[4], atoi(argv[5])); |
114 | else { | 110 | else { |
@@ -121,7 +117,6 @@ printf("\n"); | |||
121 | else // regular ethernet | 117 | else // regular ethernet |
122 | net_create_macvlan(argv[3], argv[4], atoi(argv[5])); | 118 | net_create_macvlan(argv[3], argv[4], atoi(argv[5])); |
123 | } | 119 | } |
124 | #endif | ||
125 | } | 120 | } |
126 | else if (argc == 7 && strcmp(argv[1], "config") == 0 && strcmp(argv[2], "interface") == 0) { | 121 | else if (argc == 7 && strcmp(argv[1], "config") == 0 && strcmp(argv[2], "interface") == 0) { |
127 | char *dev = argv[3]; | 122 | char *dev = argv[3]; |