aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/examples
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2010-11-26 13:47:13 (GMT)
committerJouni Malinen <j@w1.fi>2010-11-26 13:47:13 (GMT)
commitafa4926c95647aab3abea407508101cbfeb1ef00 (patch)
treeca9b324ef7d3de84d577a966c67cac724615e906 /wpa_supplicant/examples
parent0fb337c12148646bc68ed742bd7723e858885ee6 (diff)
downloadhostap-afa4926c95647aab3abea407508101cbfeb1ef00.zip
hostap-afa4926c95647aab3abea407508101cbfeb1ef00.tar.gz
hostap-afa4926c95647aab3abea407508101cbfeb1ef00.tar.bz2
P2P: Use alternative way of starting dnsmasq if needed
Some other dnsmasq users (like libvirt) seem to be binding the DHCP server to all interfaces which prevents the previously used mechanism here from working (bind on the DHCP socket fails). If a failure is noticed, try to start dnsmasq with -z option to avoid that.
Diffstat (limited to 'wpa_supplicant/examples')
-rwxr-xr-xwpa_supplicant/examples/p2p-action.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/wpa_supplicant/examples/p2p-action.sh b/wpa_supplicant/examples/p2p-action.sh
index 38fd8d6..8759f54 100755
--- a/wpa_supplicant/examples/p2p-action.sh
+++ b/wpa_supplicant/examples/p2p-action.sh
@@ -27,9 +27,15 @@ if [ "$CMD" = "P2P-GROUP-STARTED" ]; then
rm /var/run/dhclient.leases-$GIFNAME
kill_daemon dnsmasq /var/run/dnsmasq.pid-$GIFNAME
ifconfig $GIFNAME 192.168.42.1 up
- dnsmasq -x /var/run/dnsmasq.pid-$GIFNAME \
+ if ! dnsmasq -x /var/run/dnsmasq.pid-$GIFNAME \
-i $GIFNAME \
- -F192.168.42.11,192.168.42.99
+ -F192.168.42.11,192.168.42.99; then
+ # another dnsmasq instance may be running and blocking us; try to
+ # start with -z to avoid that
+ dnsmasq -x /var/run/dnsmasq.pid-$GIFNAME \
+ -i $GIFNAME \
+ -F192.168.42.11,192.168.42.99 --listen-address 192.168.42.1 -z
+ fi
fi
if [ "$4" = "client" ]; then
kill_daemon dhclient /var/run/dhclient-$GIFNAME.pid