Skip to content

Commit 4ab655b

Browse files
Keep "normal" Ski networking by default
As we can either have "normal" Ski networking or TUN/TAP networking, enable TUN/TAP support only when configured with `--enable-tuntap` and only when networking is enabled for Ski. Signed-off-by: Johnny Mnemonic <jm@machine-hall.org>
1 parent cb60176 commit 4ab655b

File tree

1 file changed

+25
-19
lines changed

1 file changed

+25
-19
lines changed

configure.ac

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -80,29 +80,35 @@ AS_IF([test "$HOST_OS" = linux], [
8080
AS_HELP_STRING([--disable-netdev], [disable netdev support]))
8181
AS_IF([test "x$enable_netdev" != xno], [
8282
AC_DEFINE(SKINET_ENABLE, 1, [define if you want netdev support])
83-
])
84-
])
8583
86-
dnl Check that the host supports TUN/TAP devices
87-
AC_CACHE_CHECK([whether TUN/TAP is supported],
88-
ac_cv_have_tun_tap, [
89-
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
90-
#include <string.h>
91-
#include <sys/socket.h>
92-
#include <linux/if.h>
93-
#include <linux/if_tun.h>
94-
]], [[
95-
struct ifreq ifr;
96-
memset(&ifr, 0, sizeof(ifr));
97-
ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
98-
]])],[ac_cv_have_tun_tap=yes],[ac_cv_have_tun_tap=no
84+
dnl Enable TUN/TAP support on request...
85+
AC_ARG_ENABLE([tuntap],
86+
AS_HELP_STRING([--enable-tuntap], [enable TUN/TAP support]), [
87+
88+
dnl Check that the host supports TUN/TAP devices
89+
AC_CACHE_CHECK([whether TUN/TAP is supported],
90+
ac_cv_have_tun_tap, [
91+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
92+
#include <string.h>
93+
#include <sys/socket.h>
94+
#include <linux/if.h>
95+
#include <linux/if_tun.h>
96+
]], [[
97+
struct ifreq ifr;
98+
memset(&ifr, 0, sizeof(ifr));
99+
ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
100+
]])],[ac_cv_have_tun_tap=yes],[ac_cv_have_tun_tap=no
101+
])
102+
])
103+
104+
AS_IF([test "$ac_cv_have_tun_tap" = yes], [
105+
AC_DEFINE(HAVE_TUN_TAP, 1, [define if you have TUN/TAP support])
106+
])
107+
])
108+
dnl ...else use stock networking.
99109
])
100110
])
101111

102-
AS_IF([test "$ac_cv_have_tun_tap" = yes], [
103-
AC_DEFINE(HAVE_TUN_TAP, 1, [define if you have TUN/TAP support])
104-
])
105-
106112
AS_IF([test "$HOST_OS" = freebsd], [
107113
LDFLAGS="$LDFLAGS -lutil"
108114
])

0 commit comments

Comments
 (0)