Skip to content

Commit

Permalink
miniupnpd: update to mainline version
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Taht committed Sep 24, 2012
1 parent 49a0b57 commit 97815a0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 31 deletions.
6 changes: 3 additions & 3 deletions net/miniupnpd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk

PKG_NAME:=miniupnpd
PKG_VERSION:=1.6.20120320
PKG_RELEASE:=4
PKG_VERSION:=1.6.20110730
PKG_RELEASE:=6

PKG_SOURCE_URL:=http://miniupnp.free.fr/files
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_MD5SUM:=f2b1a82436e968880ab057cc6eb4ff7f
PKG_MD5SUM:=8bd5c0447b6dc1101b96e958ee67d3ea

include $(INCLUDE_DIR)/package.mk

Expand Down
8 changes: 4 additions & 4 deletions net/miniupnpd/files/miniupnpd.iface.hotplug
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/sh

/etc/init.d/miniupnpd enabled && [ -n "`pidof miniupnpd`" ] && [ "$ACTION" = "ifup" ] && {
local intif
for intif in $(uci_get upnpd config internal_iface); do
[ "$INTERFACE" = "$intif" ] && /etc/init.d/miniupnpd restart
/etc/init.d/miniupnpd enabled && [ "$ACTION" = "ifup" ] && {
local iface
for iface in $(uci_get upnpd config internal_iface; uci_get upnpd config external_iface); do
[ "$INTERFACE" = "$iface" ] && /etc/init.d/miniupnpd restart
done
}
31 changes: 7 additions & 24 deletions net/miniupnpd/files/miniupnpd.init
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,8 @@ upnpd_write_bool() {
fi
}

upnpd_netmask2prefix() {
local octet
local prefix=0
local IFS="."

set -- $1

for octet in $1 $2 $3 $4; do
while [ $octet -gt 0 ]; do
prefix=$(($prefix + ($octet & 1)))
octet=$(($octet >> 1))
done
done

return $prefix
boot() {
return
}

start() {
Expand Down Expand Up @@ -103,11 +90,10 @@ start() {

local args

include /lib/network
scan_interfaces
. /lib/functions/network.sh

local ifname
config_get ifname ${extiface:-wan} ifname
network_get_device ifname ${extiface:-wan}

if [ -n "$conffile" ]; then
args="-f $conffile"
Expand All @@ -123,12 +109,9 @@ start() {

local iface
for iface in ${intiface:-lan}; do
local ipaddr netmask
config_get ipaddr "$iface" ipaddr
config_get netmask "$iface" netmask "255.255.255.0"
[ -n "$ipaddr" ] && {
upnpd_netmask2prefix "$netmask"
echo "listening_ip=$ipaddr/$?" >>$tmpconf
local ipnet
network_get_subnet ipnet "$iface" && {
echo "listening_ip=$ipnet" >>$tmpconf
}
done

Expand Down

0 comments on commit 97815a0

Please sign in to comment.