Changeset 31754
- Timestamp:
- 2012-05-16T15:03:54+02:00 (6 years ago)
- Location:
- trunk/package/firewall
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/package/firewall/Makefile
r31014 r31754 10 10 11 11 PKG_VERSION:=2 12 PKG_RELEASE:= 4912 PKG_RELEASE:=50 13 13 14 14 include $(INCLUDE_DIR)/package.mk -
trunk/package/firewall/files/reflection.hotplug
r27979 r31754 2 2 3 3 . /etc/functions.sh 4 . /usr/share/libubox/jshn.sh 5 6 find_iface_address() 7 { 8 local iface="$1" 9 local ipaddr="$2" 10 local prefix="$3" 11 12 local tmp="$(ubus call network.interface."$iface" status 2>/dev/null)" 13 14 json_load "${tmp:-{}}" 15 json_get_type tmp address 16 17 if [ "$tmp" = array ]; then 18 19 json_select address 20 json_get_type tmp 1 21 22 if [ "$tmp" = object ]; then 23 24 json_select 1 25 [ -n "$ipaddr" ] && json_get_var "$ipaddr" address 26 [ -n "$prefix" ] && json_get_var "$prefix" mask 27 28 fi 29 fi 30 } 4 31 5 32 if [ "$ACTION" = "add" ] && [ "$INTERFACE" = "wan" ]; then 6 local wanip=$(uci -P/var/state get network.wan.ipaddr) 33 local wanip 34 find_iface_address wan wanip 35 [ -n "$wanip" ] || return 7 36 8 37 iptables -t nat -F nat_reflection_in 2>/dev/null || { … … 61 90 local net 62 91 for net in $(find_networks "$dest"); do 63 local lanip=$(uci -P/var/state get network.$net.ipaddr) 64 local lanmk=$(uci -P/var/state get network.$net.netmask) 92 local lanip lanmk 93 find_iface_address "$net" lanip lanmk 94 [ -n "$lanip" ] || return 65 95 66 96 local proto
Note: See TracChangeset
for help on using the changeset viewer.