aboutsummaryrefslogtreecommitdiffstats
path: root/src/fnet/veth.c
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2018-07-25 10:21:19 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2018-07-25 10:21:19 -0400
commitb78cc5869307ddb93a7b1795af992356a54d1d21 (patch)
tree025fa10749d4e5c0cf29805ecde5698a59ef3d41 /src/fnet/veth.c
parentAdd profile for patch and shellcheck (diff)
downloadfirejail-b78cc5869307ddb93a7b1795af992356a54d1d21.tar.gz
firejail-b78cc5869307ddb93a7b1795af992356a54d1d21.tar.zst
firejail-b78cc5869307ddb93a7b1795af992356a54d1d21.zip
fix --net=wlan
Diffstat (limited to 'src/fnet/veth.c')
-rw-r--r--src/fnet/veth.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/fnet/veth.c b/src/fnet/veth.c
index 36362f1c1..39a4f35d8 100644
--- a/src/fnet/veth.c
+++ b/src/fnet/veth.c
@@ -50,6 +50,13 @@
50#include <linux/veth.h> 50#include <linux/veth.h>
51#include <net/if.h> 51#include <net/if.h>
52 52
53// Debian Jessie and distributions before that don't have support for IPVLAN
54// in /usr/include/linux/if_link.h. We only need a definition for IPVLAN_MODE_L2.
55// The kernel version detection happens at run time.
56#ifndef IFLA_IPVLAN_MAX
57#define IPVLAN_MODE_L2 0
58#endif
59
53struct iplink_req 60struct iplink_req
54{ 61{
55 struct nlmsghdr n; 62 struct nlmsghdr n;
@@ -176,7 +183,6 @@ int net_create_macvlan(const char *dev, const char *parent, unsigned pid) {
176 return 0; 183 return 0;
177} 184}
178 185
179#ifdef IPVLAN_MODE_L2
180int net_create_ipvlan(const char *dev, const char *parent, unsigned pid) { 186int net_create_ipvlan(const char *dev, const char *parent, unsigned pid) {
181 int len; 187 int len;
182 struct iplink_req req; 188 struct iplink_req req;
@@ -238,7 +244,6 @@ int net_create_ipvlan(const char *dev, const char *parent, unsigned pid) {
238 244
239 return 0; 245 return 0;
240} 246}
241#endif
242 247
243// move the interface dev in namespace of program pid 248// move the interface dev in namespace of program pid
244// when the interface is moved, netlink does not preserve interface configuration 249// when the interface is moved, netlink does not preserve interface configuration