aboutsummaryrefslogtreecommitdiff
path: root/net/shorewall6
diff options
context:
space:
mode:
authorHannu Nyman <hannu.nyman@iki.fi>2019-03-27 17:28:56 +0200
committerGitHub <noreply@github.com>2019-03-27 17:28:56 +0200
commitde5efc91b304c13601403436c130a92d5b8f6805 (patch)
tree8398d9447566d680cd011644f06dcfbf868e5e27 /net/shorewall6
parentffe6b67abcc0d4b8e03558d86420d71db66a6daa (diff)
parent7646712f393210532e4de5d9ba10a66559284ba4 (diff)
Merge pull request #8319 from brianjmurrell/shorewall-iface-update
Shorewall: start and enable interfaces all in hotplug
Diffstat (limited to 'net/shorewall6')
-rw-r--r--net/shorewall6/Makefile2
-rw-r--r--net/shorewall6/files/hotplug_iface14
2 files changed, 11 insertions, 5 deletions
diff --git a/net/shorewall6/Makefile b/net/shorewall6/Makefile
index d090556f7..7aa3d26c9 100644
--- a/net/shorewall6/Makefile
+++ b/net/shorewall6/Makefile
@@ -14,7 +14,7 @@ PKG_BUGFIX_MAJOR_VERSION:=3
PKG_BUGFIX_MINOR_VERSION:=.2
PKG_VERSION:=$(PKG_MAJOR_MINOR_VERSION).$(PKG_BUGFIX_MAJOR_VERSION)$(PKG_BUGFIX_MINOR_VERSION)
PKG_DIRECTORY:=$(PKG_MAJOR_MINOR_VERSION).$(PKG_BUGFIX_MAJOR_VERSION)
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE_URL:=http://www.shorewall.net/pub/shorewall/$(PKG_MAJOR_MINOR_VERSION)/shorewall-$(PKG_DIRECTORY)/ \
http://www1.shorewall.net/pub/shorewall/$(PKG_MAJOR_MINOR_VERSION)/shorewall-$(PKG_DIRECTORY)/ \
diff --git a/net/shorewall6/files/hotplug_iface b/net/shorewall6/files/hotplug_iface
index aaa03e8a9..bfe2bf7b1 100644
--- a/net/shorewall6/files/hotplug_iface
+++ b/net/shorewall6/files/hotplug_iface
@@ -1,13 +1,19 @@
#!/bin/sh
-# should restart shorewall when an interface comes up
+DEVICE=${DEVICE:-$(/sbin/uci -p /var/state get network."$INTERFACE".ifname)}
case "$ACTION" in
ifup)
- /etc/init.d/shorewall6 restart
+ if [ "$INTERFACE" = "lan" ]; then
+ /usr/sbin/shorewall -6 start
+ elif [ "${INTERFACE:0:3}" = "wan" ] &&
+ [ "${INTERFACE:$((${#INTERFACE}-2)):2}" != "_6" ]; then
+ /etc/shorewall6/state/firewall enable "$DEVICE"
+ fi
;;
ifdown)
- # might need to restore some routing
- /etc/init.d/shorewall6 restart
+ if [ "${INTERFACE:0:3}" = "wan" ]; then
+ /etc/shorewall6/state/firewall disable "$DEVICE"
+ fi
;;
esac