miniupnpd: add option to enable NAT-PMP (#8747)
authorJo-Philipp Wich <jow@openwrt.org>
Sun, 30 Jan 2011 00:56:41 +0000 (00:56 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Sun, 30 Jan 2011 00:56:41 +0000 (00:56 +0000)
SVN-Revision: 25251

net/miniupnpd/Makefile
net/miniupnpd/files/miniupnpd.init

index 131bf82e1b38db3da0ce2acb45ce747591e6984f..18d0899db66518a7d5834c382830444d5ddd74f0 100644 (file)
@@ -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
index 5f176f40eb1d88dfaa2ed64668b7b81cb404e425..12cb550e217e0017c8d1b1ce2f024dd557ed89c5 100644 (file)
@@ -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