From: <abe...@us...> - 2012-07-16 02:50:49
|
Revision: 5611 http://astlinux.svn.sourceforge.net/astlinux/?rev=5611&view=rev Author: abelbeck Date: 2012-07-16 02:50:42 +0000 (Mon, 16 Jul 2012) Log Message: ----------- miniupnpd, add optional port-range to UPNP_ALLOW internal addresses Modified Paths: -------------- branches/1.0/package/miniupnpd/miniupnpd.init branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf Modified: branches/1.0/package/miniupnpd/miniupnpd.init =================================================================== --- branches/1.0/package/miniupnpd/miniupnpd.init 2012-07-14 05:49:34 UTC (rev 5610) +++ branches/1.0/package/miniupnpd/miniupnpd.init 2012-07-16 02:50:42 UTC (rev 5611) @@ -63,15 +63,27 @@ upnp_allow() { - local addr allow IFS + local i addr port allow portrange IFS unset IFS - for addr in $UPNP_ALLOW; do + for i in $UPNP_ALLOW; do + + addr="$(echo $i | cut -d'~' -f1)" case $addr in */*) allow="$addr" ;; *) allow="$addr/32" ;; esac - echo "allow 1024-65535 ${allow} 1024-65535" + + port="$(echo $i | cut -d'~' -f2)" + if [ -z "$port" ]; then + portrange="1024-65535" + elif [ -z "$(echo "$port" | tr -d '0123456789-')" ]; then + portrange="$port" + else + portrange="1024-65535" + fi + + echo "allow 1024-65535 ${allow} ${portrange}" done } Modified: branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf =================================================================== --- branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2012-07-14 05:49:34 UTC (rev 5610) +++ branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2012-07-16 02:50:42 UTC (rev 5611) @@ -418,8 +418,10 @@ ## "DMZIF" for DMZ Interface #UPNP_LISTEN="INTIF" ## Optional, restrict allowed IPv4 addresses or CIDR's in UPNP_ALLOW, space separated for multiple. +## Additionally, an optional internal port or port-range may also be specified separated +## from the internal address by a ~ (tilde), defaults to 1024-65535 if not specified. ## By default all of the networks of the UPNP_LISTEN interfaces will be allowed. -#UPNP_ALLOW="192.168.101.20 192.168.101.88/29" +#UPNP_ALLOW="192.168.101.20 192.168.101.88/29 192.168.101.21~22 192.168.101.22~3000-4000" ## UPnP Options #UPNP_BITRATE_UP=1000000 #UPNP_BITRATE_DOWN=10000000 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |