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

Kel Modderman kelrin at tpg.com.au
Sun Aug 6 13:09:45 UTC 2006


Hi Felix,

On Sunday 06 August 2006 21:18, Felix Homann wrote:
> Hi Kel,
>
> sorry for being a bit late in responding and big thanks for your
> enhancements! More details below:

cool, I've been waiting ;-)

> > 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.)

Ok. Then maybe this warning/suggestion should be incorporated into the new 
documentation.

>
> > 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'?

Okay then, we'll use shell built-in 'type' as a simple validity check of the 
mapping script. This is not as strict as I'd personally like, but should catch 
at least stupid typo's.

Note we cannot use 'type -p' to get the absolute path, dash 's type doesn't 
support this.

>
> > 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.

Ok, I agree.

If WPA_LOGICAL_IFACE is returned from the mapping script we use it without 
validating its existence in /e/n/i.

But; in previous mails, you wanted to fallback to guessnet mappings when 
the 'id_str' mapping was not present in /e/n/i, so this is somewhat 
inconsistent, imho.

Maybe it should be a case of 'use one mapping method or the other', and do not 
allow the possibility to mix and match?


>
> > 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.

Interesting.

>
> 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.

Ok, I see your thinking; maybe there should be no hardcoded fallback at all?

This way we can add the 'wpa-roam-default-iface' option and document its usage 
and purpose. This would mean that a logical interface stanza must exist for 
each known network including the fallback logical interface, and 
specifying 'wpa-roam-default-iface' would be mandatory to activate the 
fallback option.

My primary concern is that people who've already picked up on wpa-roam and are 
using the 'default' fallback mapping will be bitten by any changes in this 
regard.

On the other hand, wpa-roam has hardly been documented until now, so it *is* 
the time to be making such decisions.

However, with a default fallback using the dhcp inet method, simple roaming is 
brain dead easy to setup. And I like that. But the dilemna remains:

Should we have a hardcoded fallback? And if so, should it be 'default' 
or 'none' ?

More comments?

>
> > 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.

Yep, agreed. I've contacted Enrico on irc, he's not very active on guessnet 
anymore. He suggested that we get madduck involved in this discussion.

>
> > 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!
>

Me too.

Thanks, Kel.



More information about the Pkg-wpa-devel mailing list