X-Git-Url: http://git.ozo.com/?p=openwrt-10.03%2F.git;a=blobdiff_plain;f=package%2Ffirewall%2Ffiles%2Flib%2Fcore_init.sh;h=185fffb98bcf7bd38653b6222c857df01718f626;hp=c7e41e7ff7dada3ad8015d741c8e894240e78376;hb=2c4bf4b19f72c067cac60883f00153fd5fc3b8f6;hpb=fe72fdb0222ffa56be4fc263e476126e95ccd77c diff --git a/package/firewall/files/lib/core_init.sh b/package/firewall/files/lib/core_init.sh index c7e41e7ff..185fffb98 100644 --- a/package/firewall/files/lib/core_init.sh +++ b/package/firewall/files/lib/core_init.sh @@ -245,9 +245,17 @@ fw_load_zone() { if [ "$zone_masq" == 1 ]; then local msrc mdst for msrc in ${zone_masq_src:-0.0.0.0/0}; do - fw_get_negation msrc '-s' "$msrc" + case "$msrc" in + *.*) fw_get_negation msrc '-s' "$msrc" ;; + *) fw_get_subnet4 msrc '-s' "$msrc" ;; + esac + for mdst in ${zone_masq_dest:-0.0.0.0/0}; do - fw_get_negation mdst '-d' "$mdst" + case "$mdst" in + *.*) fw_get_negation mdst '-d' "$mdst" ;; + *) fw_get_subnet4 mdst '-d' "$mdst" ;; + esac + fw add $mode n ${chain}_nat MASQUERADE $ { $msrc $mdst } done done @@ -271,8 +279,10 @@ fw_load_notrack_zone() { fw_load_include() { local name="$1" - local path; config_get path ${name} path - [ -e $path ] && . $path + local path + config_get path ${name} path + + [ -e $path ] && ( . $path ) }