add --firewall=<name> to genconfig.sh & tweak Makefiles to match

This commit is contained in:
Paul Chambers 2019-09-28 22:17:51 -07:00
parent 48f2339759
commit d5773600f9
3 changed files with 15 additions and 5 deletions

View File

@ -21,6 +21,7 @@
# ./configure them and build them then miniupnpd will build using :
# $ IPTABLESPATH=/path/to/iptables-1.4.1 make -f Makefile.linux
#
CONFIG_OPTIONS += --firewall=iptables
#CFLAGS = -O -g -DDEBUG
CFLAGS ?= -Os
CFLAGS += -fno-strict-aliasing
@ -193,6 +194,7 @@ EXECUTABLES = miniupnpd testupnpdescgen testgetifstats \
all: $(EXECUTABLES)
clean:
$(RM) config.h
$(RM) $(ALLOBJS)
$(RM) $(EXECUTABLES)
$(RM) testupnpdescgen.o testgetifstats.o

View File

@ -16,6 +16,7 @@
# (default INSTALLPREFIX is /usr)
#
#
CONFIG_OPTIONS += --firewall=nftables
CFLAGS = -O -g #-DDEBUG
CFLAGS ?= -Os
CFLAGS += -fno-strict-aliasing
@ -108,6 +109,7 @@ EXECUTABLES = miniupnpd miniupnpdctl \
all: $(EXECUTABLES)
clean:
$(RM) config.h
$(RM) $(ALLOBJS)
$(RM) $(EXECUTABLES)
$(RM) testupnpdescgen.o testgetifstats.o

View File

@ -32,6 +32,8 @@ case "$argv" in
exit 1
fi ;;
--disable-pppconn) DISABLEPPPCONN=1 ;;
--firewall=*)
FW=$(echo $argv | cut -d= -f2) ;;
--help|-h)
echo "Usage : $0 [options]"
echo " --ipv6 enable IPv6"
@ -43,6 +45,7 @@ case "$argv" in
echo " --portinuse enable port in use check"
echo " --uda-version=x.x set advertised UPnP version (default to ${UPNP_VERSION_MAJOR}.${UPNP_VERSION_MINOR})"
echo " --disable-pppconn disable WANPPPConnection"
echo " --firewall=<name> force the firewall type (only for linux)"
exit 1
;;
*)
@ -316,11 +319,14 @@ case $OS_NAME in
esac
fi
echo "#define USE_IFACEWATCHER 1" >> ${CONFIGFILE}
# Would be better to check for actual presence of nftable rules, but that requires root privileges
if [ -x "$(command -v nft)" ]; then
FW=nftables
else
FW=iptables
if [ -z ${FW} ]; then
# test the current environment to determine which to use
# Would be better to check for actual presence of nftable rules, but that requires root privileges
if [ -x "$(command -v nft)" ]; then
FW=nftables
else
FW=iptables
fi
fi
V6SOCKETS_ARE_V6ONLY=`/sbin/sysctl -n net.ipv6.bindv6only`
;;