mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-19 13:48:06 +00:00
firewall: protect iptables invocations with locks in interface ops, it might run concurrently due to hotplug invocations on network restart
SVN-Revision: 23090
This commit is contained in:
parent
a5d0879de7
commit
b07620df31
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||
PKG_NAME:=firewall
|
||||
|
||||
PKG_VERSION:=2
|
||||
PKG_RELEASE:=16
|
||||
PKG_RELEASE:=17
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
|
@ -72,6 +72,8 @@ fw_configure_interface() {
|
||||
*/*.*) fw_log info "zone $zone does not support IPv4 address family, skipping"; return ;;
|
||||
esac
|
||||
|
||||
lock /var/run/firewall-interface.lock
|
||||
|
||||
fw $action $mode f ${chain}_ACCEPT ACCEPT $ { -o "$ifname" $onet }
|
||||
fw $action $mode f ${chain}_ACCEPT ACCEPT $ { -i "$ifname" $inet }
|
||||
fw $action $mode f ${chain}_DROP DROP $ { -o "$ifname" $onet }
|
||||
@ -86,6 +88,8 @@ fw_configure_interface() {
|
||||
fw $action $mode n PREROUTING ${chain}_prerouting $ { -i "$ifname" $inet }
|
||||
fw $action $mode r PREROUTING ${chain}_notrack $ { -i "$ifname" $inet }
|
||||
fw $action $mode n POSTROUTING ${chain}_nat $ { -o "$ifname" $onet }
|
||||
|
||||
lock -u /var/run/firewall-interface.lock
|
||||
}
|
||||
|
||||
local old_zones old_ifname old_subnets
|
||||
|
Loading…
Reference in New Issue
Block a user