[pkg-wpa-devel] Re: Patch: Support for mapping scripts, e.g. guessnet

Kel Modderman kelrin at tpg.com.au
Sat Aug 5 05:19:54 UTC 2006


Hi Felix and list,

Okay, I spent quite some time looking at this, my observations follow, and my 
(current) version of this functionality is attached in patch form, and also 
I've uploaded the source and binary packages to my site for testing.

1. Using external mapping logic means the setup will not honour the 'reload' 
function of wpa_action. The IF_WPA_* environmental variables are only taken 
from the environment that wpa_cli was daemonized from => the environment 
provided by the interfaces stanza of the physical roaming device at the time 
of *initial* ifup. Therefore, when adding a new network + mapping, it would 
be required to stop the daemon to add extra wpa-map* lines, so that the 
action script's environment is aware of the changes.

2.  I would prefer to do sanity checking of IF_WPA_MAPPING_SCRIPT_PRIORITY and 
IF_WPA_MAPPING_SCRIPT in ifupdown.sh before allowing the action script to 
start, because later it would _always_ fail.

3. Use WPA_LOGICAL_IFACE instead of LOGICAL_IFACE to avoid similarities with 
ifupdown's LOGICAL env variable now, and in the future.

4. Force the admin to give the absolute path to the (executable) 
wpa-mapping-script. /usr/bin/which may not be present when networking starts, 
and its not too much to ask, IMHO.

5. Remove brace expansion. Instead use set and sed to get a list of all 
IF_WPA_MAP env variables and form a single string from then with a for loop. 
The string is then given as STDIN to the mapping script. This should also 
scale to allow as many IF_WPA_MAP lines as the shell can manage.

6. Verify that the WPA_LOGICAL_IFACE returned by the mapping script is defined 
in /etc/network/interfaces with a quick grep.

7. Don't always return with error in this function, but rather just unset 
WPA_LOGICAL_IFACE (or simply do not set it). ifupdown will not be called when 
it is not set.

8. Changed wpa-script-priority => wpa-mapping-script-priority. It can be set 
to any value to be active, but we'll document it as '1' to activate it.

9. Fallback to logical interface "none", but provide backwards compatibility 
to the "default" action we have documented so far. This makes using wpa-roam 
with guessnet easier to follow.

10. I'm concerned that guessnet installs itself under /usr, this may not be 
mounted at the time networking wants it.


Lets discuss the changes and make the code work exactly as it should. I like 
it. When we decide thats going to stick, lets document it together.

Here is my very simple but "working" interfaces stanza:

allow-hotplug eth1
iface eth1 inet manual
	#wpa-roam-maint-debug 1
	wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
	wpa-mapping-script /usr/sbin/guessnet-ifupdown
	#wpa-mapping-script-priority 1
	wpa-map0 home_dhcp
	wpa-map1 home_static

iface none inet dhcp

iface home_dhcp inet dhcp
	test peer address 192.168.0.1

iface home_static inet static
	address 192.168.0.5
	netmask 255.255.255.0
	network 192.168.0.0
	broadcast 192.168.0.255
	gateway 192.168.0.1
	test peer address 192.168.0.2

I tried a whole myriad of variations where id_str was/wasn't given, tests were 
designed to fail etc. Now its time for others to test it out ;-)

Package source:
http://users.tpg.com.au/sigm/misc/pkg-wpa/roaming_expt/wpasupplicant_0.5.4-4.dsc

and binaries for i386:
http://users.tpg.com.au/sigm/misc/pkg-wpa/roaming_expt/binary-i386/

Please be careful, they are tagged as UNRELEASED, so take care to make sure 
you don't spoil your upgrade path.

Thanks, Kel.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wpa_mapping-kelmo.patch
Type: text/x-diff
Size: 4784 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pkg-wpa-devel/attachments/20060805/51b923cf/wpa_mapping-kelmo.bin


More information about the Pkg-wpa-devel mailing list