From b838faf06bfc01854ccd3445b4561c6acbbbb68e Mon Sep 17 00:00:00 2001 From: jow Date: Sun, 30 Jan 2011 00:56:41 +0000 Subject: [PATCH] [packages] miniupnpd: add option to enable NAT-PMP (#8747) git-svn-id: svn://svn.openwrt.org/openwrt/packages@25251 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- net/miniupnpd/Makefile | 2 +- net/miniupnpd/files/miniupnpd.init | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/net/miniupnpd/Makefile b/net/miniupnpd/Makefile index 131bf82e1..18d0899db 100644 --- a/net/miniupnpd/Makefile +++ b/net/miniupnpd/Makefile @@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=miniupnpd PKG_VERSION:=1.5 -PKG_RELEASE:=4 +PKG_RELEASE:=5 PKG_MD5SUM:=063f03a2a8363b9d4cb0f73b20b8dfce PKG_SOURCE_URL:=http://miniupnp.free.fr/files diff --git a/net/miniupnpd/files/miniupnpd.init b/net/miniupnpd/files/miniupnpd.init index 5f176f40e..12cb550e2 100644 --- a/net/miniupnpd/files/miniupnpd.init +++ b/net/miniupnpd/files/miniupnpd.init @@ -6,7 +6,7 @@ start() { ACTION=- . /etc/hotplug.d/firewall/50-miniupnpd config_load "upnpd" - local extiface intiface upload download logging secure enabled + local extiface intiface upload download logging secure enabled natpmp config_get extiface config external_iface config_get intiface config internal_iface @@ -14,6 +14,7 @@ start() { config_get download config download config_get_bool logging config log_output 0 config_get_bool secure config secure_mode 0 + config_get_bool natpmp config enable_natpmp 0 config_get_bool enabled config enabled 0 include /lib/network @@ -40,11 +41,8 @@ start() { [ "$secure" -gt 0 ] && \ append args "-S" - if [ "$logging" = "1" ]; then - [ "$enabled" -gt 0 ] && eval start-stop-daemon -S -x miniupnpd -- $args -d | logger -t miniupnpd & - else - [ "$enabled" -gt 0 ] && eval start-stop-daemon -S -x miniupnpd -- $args 2>/dev/null - fi + [ "$natpmp" -gt 0 ] && \ + append args "-N" # start firewall local zone @@ -52,6 +50,12 @@ start() { config_get zone core "${extiface:-wan}_zone" [ -n "$zone" ] && \ miniupnpd_add_rules "$zone" "${extiface:-wan}" "$ifname" + + if [ "$logging" = "1" ]; then + [ "$enabled" -gt 0 ] && eval start-stop-daemon -S -x miniupnpd -- $args -d | logger -t miniupnpd & + else + [ "$enabled" -gt 0 ] && eval start-stop-daemon -S -x miniupnpd -- $args 2>/dev/null + fi else logger -t "upnp daemon" "external interface not found, not starting" fi