Skip to content

Commit 0041fca

Browse files
committed
add support for disabling VXLAN/eBPF support
This makes it easier to backport or de-bloat on smaller systems Signed-off-by: Felix Fietkau <[email protected]>
1 parent 5d79b88 commit 0041fca

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

CMakeLists.txt

+10-2
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,26 @@ ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3 -Wmissing-declarations -DRUNST
1414
FIND_LIBRARY(libjson NAMES json-c json)
1515

1616
OPTION(UBUS_SUPPORT "enable ubus support" ON)
17+
OPTION(VXLAN_SUPPORT "enable VXLAN support" ON)
1718
IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
1819
FIND_LIBRARY(nl nl-tiny)
20+
SET(SOURCES ${SOURCES} wg-linux.c)
21+
ELSE()
22+
SET(nl "")
23+
SET(VXLAN_SUPPORT OFF)
24+
ENDIF()
25+
IF(VXLAN_SUPPORT)
1926
find_library(bpf NAMES bpf)
2027
find_library(elf NAMES elf)
2128
find_library(zlib NAMES z)
22-
SET(SOURCES ${SOURCES} wg-linux.c vxlan.c bpf.c rtnl.c)
29+
SET(SOURCES ${SOURCES} bpf.c vxlan.c rtnl.c)
30+
ADD_DEFINITIONS(-DVXLAN_SUPPORT)
2331
ELSE()
24-
SET(nl "")
2532
SET(bpf "")
2633
SET(elf "")
2734
SET(zlib "")
2835
ENDIF()
36+
2937
IF(UBUS_SUPPORT)
3038
SET(SOURCES ${SOURCES} ubus.c)
3139
ADD_DEFINITIONS(-DUBUS_SUPPORT=1)

service.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ service_add(struct network *net, struct blob_attr *data)
126126
s->type = strcpy(type_buf, type);
127127
if (config)
128128
s->config = memcpy(config_buf, config, blob_pad_len(config));
129-
#ifdef linux
129+
#ifdef VXLAN_SUPPORT
130130
if (type && !strcmp(type, "vxlan"))
131131
s->ops = &vxlan_ops;
132132
#endif

0 commit comments

Comments
 (0)