diff options
Diffstat (limited to 'src/fnet/veth.c')
-rw-r--r-- | src/fnet/veth.c | 9 |
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 | |||
53 | struct iplink_req | 60 | struct 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 | ||
180 | int net_create_ipvlan(const char *dev, const char *parent, unsigned pid) { | 186 | int 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 |