Subject: kern/32168: recent net80211 changes break ifwatchd
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <rpaulo@NetBSD.org>
List: netbsd-bugs
Date: 11/26/2005 19:05:00
>Number:         32168
>Category:       kern
>Synopsis:       recent net80211 changes break ifwatchd
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Nov 26 19:05:00 +0000 2005
>Originator:     rpaulo@NetBSD.org
>Release:        NetBSD 3.99.11
>Organization:
Rui Paulo
>Environment:
System: NetBSD neuron.mobile 3.99.11 NetBSD 3.99.11 (NEURON) #35: Thu Nov 24 21:15:49 WET 2005 rpaulo@neuron.mobile:/usr/obj/sys/arch/i386/compile/NEURON i386
Architecture: i386
Machine: i386
>Description:
	
	after the recent net80211 import, ifwatchd no longer works as
	it did. iwi0 associates but the interface goes up and down a
	lot more often than previously when dhclient is started, so
	ifwatchd cannot detect correctly when carrier changes.
	this access point is open/WEP 104.

	rc.conf:
	ifwatchd=yes    ifwatchd_flags="-c /etc/dhcp/carrier-script iwi0"

	/etc/dhcp/carrier-script:
	#!/bin/sh

	pkill dhclient 
	dhclient -q $1

	/var/log/messages:
	Nov 26 16:45:37 neuron /usr/sbin/ifwatchd[23324]: calling: /etc/dhcp/carrier-script iwi0 /dev/null 9600   
	Nov 26 16:45:39 neuron /netbsd: iwi0: link state changed to UP
	Nov 26 16:45:41 neuron dhclient: DHCPREQUEST on iwi0 to 255.255.255.255 port 67
	Nov 26 16:45:41 neuron dhclient: DHCPACK from 10.0.0.1
	Nov 26 16:45:41 neuron /netbsd: iwi0: link state changed to DOWN
	Nov 26 16:45:41 neuron dhclient: bound to 10.0.0.11 -- renewal in 83966 seconds.
	Nov 26 16:45:41 neuron /usr/sbin/ifwatchd[23324]: calling: /etc/dhcp/carrier-script iwi0 /dev/null 9600   
	Nov 26 16:45:42 neuron /netbsd: iwi0: link state changed to UP
	Nov 26 16:45:44 neuron dhclient: DHCPREQUEST on iwi0 to 255.255.255.255 port 67
	Nov 26 16:45:44 neuron dhclient: DHCPACK from 10.0.0.1
	Nov 26 16:45:44 neuron /netbsd: iwi0: link state changed to DOWN
	Nov 26 16:45:44 neuron dhclient: bound to 10.0.0.11 -- renewal in 79013 seconds.
	Nov 26 16:45:45 neuron /netbsd: iwi0: link state changed to UP
	Nov 26 16:45:45 neuron /usr/sbin/ifwatchd[23324]: calling: /etc/dhcp/carrier-script iwi0 /dev/null 9600   
	Nov 26 16:45:45 neuron /netbsd: iwi0: link state changed to DOWN
	Nov 26 16:45:47 neuron /netbsd: iwi0: link state changed to UP
	Nov 26 16:45:48 neuron dhclient: DHCPREQUEST on iwi0 to 255.255.255.255 port 67
	Nov 26 16:45:48 neuron dhclient: DHCPACK from 10.0.0.1
	Nov 26 16:45:48 neuron /netbsd: iwi0: link state changed to DOWN
	

>How-To-Repeat:
	
>Fix:
	Maybe ifwatchd should stop querying interface parameters while
	the script is being run?