fix external ip address detection
[openwrt/svn-archive/archive.git] / net / miniupnpd / patches / 100-iptables-wan-device-name.patch
1 diff -urN miniupnpd.orig/linux/iptables_init.sh miniupnpd/linux/iptables_init.sh
2 --- miniupnpd.orig/linux/iptables_init.sh 2007-04-13 10:02:22.291113712 -0500
3 +++ miniupnpd/linux/iptables_init.sh 2007-04-13 10:04:33.346190312 -0500
4 @@ -1,9 +1,12 @@
5 #! /bin/sh
6 # $Id: iptables_init.sh,v 1.3 2006/11/23 12:32:57 nanard Exp $
7 +. /etc/functions.sh
8 IPTABLES=iptables
9
10 #change this parameters :
11 -EXTIF=eth0
12 +include /lib/network
13 +scan_interfaces
14 +config_get EXTIF wan ifname
15 EXTIP="`LC_ALL=C /sbin/ifconfig $EXTIF | grep 'inet addr' | awk '{print $2}' | sed -e 's/.*://'`"
16 echo "External IP = $EXTIP"
17
18 diff -urN miniupnpd.orig/linux/iptables_removeall.sh miniupnpd/linux/iptables_removeall.sh
19 --- miniupnpd.orig/linux/iptables_removeall.sh 2007-04-13 10:01:53.455497392 -0500
20 +++ miniupnpd/linux/iptables_removeall.sh 2007-04-13 10:04:19.444303720 -0500
21 @@ -1,9 +1,12 @@
22 #! /bin/sh
23 # $Id: iptables_removeall.sh,v 1.3 2006/11/23 12:32:57 nanard Exp $
24 +. /etc/functions.sh
25 IPTABLES=iptables
26
27 #change this parameters :
28 -EXTIF=eth0
29 +include /lib/network
30 +scan_interfaces
31 +config_get EXTIF wan ifname
32 EXTIP="`LC_ALL=C /sbin/ifconfig $EXTIF | grep 'inet addr' | awk '{print $2}' | sed -e 's/.*://'`"
33
34 #removing the MINIUPNPD chain for nat