X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/e8be3016c98c2e7d81755c4eae34ea3c60f4b3f9..6c0f1d31579139732e9cf5cfb59da1e8ecacd683:/package/firewall/files/lib/core_forwarding.sh diff --git a/package/firewall/files/lib/core_forwarding.sh b/package/firewall/files/lib/core_forwarding.sh index 766e48e38..c4a968143 100644 --- a/package/firewall/files/lib/core_forwarding.sh +++ b/package/firewall/files/lib/core_forwarding.sh @@ -7,6 +7,7 @@ fw_config_get_forwarding() { string name "" \ string src "" \ string dest "" \ + string family "" \ } || return [ -n "$forwarding_name" ] || forwarding_name=$forwarding__name } @@ -26,14 +27,17 @@ fw_load_forwarding() { target=zone_${forwarding_dest}_ACCEPT } - fw add i f $chain $target ^ + local mode + fw_get_family_mode mode ${forwarding_family:-x} ${forwarding_dest:-${forwarding_src:--}} i + + fw add $mode f $chain $target ^ # propagate masq zone flag - [ -n "$forwarding_src" ] && list_contains CONNTRACK_ZONES $forwarding_src && { - append CONNTRACK_ZONES $forwarding_dest + [ -n "$forwarding_src" ] && list_contains FW_CONNTRACK_ZONES $forwarding_src && { + append FW_CONNTRACK_ZONES $forwarding_dest } - [ -n "$forwarding_dest" ] && list_contains CONNTRACK_ZONES $forwarding_dest && { - append CONNTRACK_ZONES $forwarding_src + [ -n "$forwarding_dest" ] && list_contains FW_CONNTRACK_ZONES $forwarding_dest && { + append FW_CONNTRACK_ZONES $forwarding_src } fw_callback post forwarding