[pkg-wpa-devel] Re: Patch: Support for mapping scripts,
e.g. guessnet
Felix Homann
fexpop at onlinehome.de
Sun Aug 6 11:18:58 UTC 2006
Hi Kel,
sorry for being a bit late in responding and big thanks for your enhancements!
More details below:
On Saturday 05 August 2006 07:19, Kel Modderman wrote:
> 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.
Great!
> 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.
Yes, sure. We should mention it in the docs. BTW, I actually stop the daemon
everytime I change something in /e/n/i just like you always should ifdown an
interface before changing /e/n/i. It might not be necessary everytime, but
it's safer. (E.g. if you delete the logical interface from /e/n/i that's
currently up you'll have some trouble ifdowning it.)
> 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.
OK.
> 3. Use WPA_LOGICAL_IFACE instead of LOGICAL_IFACE to avoid similarities
> with ifupdown's LOGICAL env variable now, and in the future.
Yes, I originally wanted to use that name, too. I've been lazy at typing
though ;-)
> 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.
Here, I disagree. I would like to be as compatible to ifupdowns mapping as
possible. Any script that can be found by ifupdown should be found by
wpa_action. Maybe we should search the path without using 'which'?
> 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.
Great!!!!!!
> 6. Verify that the WPA_LOGICAL_IFACE returned by the mapping script is
> defined in /etc/network/interfaces with a quick grep.
I had this in an early version of my patch, too. I removed it because I think
a good mapping script should take care of this. If we do this check and then
fallback to "none" or "default" it could hide the failing of a script from
the user.
Furthermore, it could even be wanted that a script returns a nonexistent
logical interface name to make sure the interface won't ifup properly.
I think we should do it as ifupdown does: Let's just pass it through.
> 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.
OK.
> 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.
OK.
> 9. Fallback to logical interface "none",
That's a good idea! I never liked falling back to "default" by default. IMO,
there should be no hardcoded default that might be found in /e/n/i
accidentally.
To be more specific: guessnet uses "none" as the default fallback. I think
it's rather unlikely that anyone has a "none" interface defined in his /e/n/i
without using guessnet. And I don't think you should use a "none" iface if
you _are_ using guessnet. You'd better specify a default one by a line "map
default: default" or "map default: fallback".
Yes, it's partially about personal taste, but if the answer to "Which logical
interface is up?" is "None!" it doesn't feel right. If "none" is returned by
a script no logical interface should be brought up.
> but provide backwards
> compatibility to the "default" action we have documented so far. This makes
> using wpa-roam with guessnet easier to follow.
Hmm, I guess this might cause some confusion. There should only be one default
fallback, no matter what logical interfaces there are in /e/n/i. I would like
falling back to "none" while introducing a "wpa-roam-default-iface" option.
> 10. I'm concerned that guessnet installs itself under /usr, this may not be
> mounted at the time networking wants it.
That's beyond our responsibility. We just provide the means to call mapping
scripts just as you can from a mapping stanza. (Sure, I've had guessnet in
mind when doing this, though.) But we could drop a note to the guessnet
maintainer.
> 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.
Sure.
I'm really looking forward to having this released!
Kind regards,
Felix
More information about the Pkg-wpa-devel
mailing list