diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2018-12-18 19:22:24 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2018-12-18 19:22:24 +0000 |
commit | 29c68cf4adf7870ca364a1d129dcece7945c0cbb (patch) | |
tree | 2f4a704bb37d78c095394044dbce7ebdc427ec5c /main/dnsmasq/dnsmasq.initd | |
parent | 3212792a0d66c68f455901f20c218dcde1dfaf24 (diff) | |
download | aports-29c68cf4adf7870ca364a1d129dcece7945c0cbb.tar.bz2 aports-29c68cf4adf7870ca364a1d129dcece7945c0cbb.tar.xz |
main/dnsmasq: listen to all BRIDGE_ADDRs
make sure dnsmasq listens to all addresses specified in BRIDGE_ADDR,
but not the ones in BRIDGE_ADDR_EXTRA. That way it is possible to have
another daemon listening to the extra address.
Also make sure we remove the addresses on service stop.
Diffstat (limited to 'main/dnsmasq/dnsmasq.initd')
-rw-r--r-- | main/dnsmasq/dnsmasq.initd | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/main/dnsmasq/dnsmasq.initd b/main/dnsmasq/dnsmasq.initd index 9af390f56b..c7e753fd4b 100644 --- a/main/dnsmasq/dnsmasq.initd +++ b/main/dnsmasq/dnsmasq.initd @@ -93,14 +93,23 @@ start_pre() { setup_firewall -I -A fi if yesno "$DNSMASQ_LISTEN_BRIDGE_ADDR"; then - command_args="$command_args --listen-address ${BRIDGE_ADDR}" + local addr + for addr in $BRIDGE_ADDR; do + command_args="$command_args --listen-address ${addr%/*}" + done fi command_args="$command_args --strict-order --bind-interfaces --except-interface=lo --interface=$BRIDGE --dhcp-range $BRIDGE_DHCP_RANGE --dhcp-lease-max=$BRIDGE_DHCP_MAX --dhcp-no-override --dhcp-leasefile=$leasefile --dhcp-authoritative" } stop_post() { if [ -n "$BRIDGE" ]; then - ip addr del ${BRIDGE_ADDR}/${BRIDGE_NETMASK} dev $BRIDGE + local addr + for addr in $BRIDGE_ADDR $BRIDGE_ADDR_EXTRA; do + case "$addr" in + */*) ip addr del $addr dev $BRIDGE;; + *) ip addr del $addr/${BRIDGE_NETMASK} dev $BRIDGE;; + esac + done ip link set dev $BRIDGE down if [ -z "$DISABLE_IPTABLES" ]; then setup_firewall -D -D |