[pkg-wpa-devel] Bug#471858: wpasupplicant: option "wpa_iface" half works - but does IP config on the wpa_iface not the actual interface (normally a bridge)
Kel Modderman
kel at otaku42.de
Wed Mar 26 01:09:25 UTC 2008
Hi Paul,
On Friday 21 March 2008 23:08:13 Paul Hedderly wrote:
> Kel Modderman wrote:
> >> I'm sure it is possible :O)
> >>
> >
> > Yes i think its a bit crazy, and yes everything is possible ;-)
> >
> > Whether or not its worth too much hassle I dunno.
> >
> >
> Actually it looks very easy... this works :O)
>
> Seems IFACE is set to the right interface. This would need to be changed
> in ifdown and ifcheckstate too.
>
> Would be better to put in a check that IFACE was set and use WPA_IFACE
> if not.
>
>
> --- /etc/wpa_supplicant/functions.sh.orig 2008-03-21
> 13:04:52.000000000 +0000
> +++ /etc/wpa_supplicant/functions.sh 2008-03-21 13:05:16.000000000 +0000
> @@ -967,13 +967,13 @@
> if [ -n "$WPA_LOGICAL_IFACE" ]; then
> if egrep --quiet
> "^iface[[:space:]]+${WPA_LOGICAL_IFACE}[[:space:]]+inet"
> "$INTERFACES_FILE"; then
>
> - echo "ifup $WPA_IFACE=$WPA_LOGICAL_IFACE"
> + echo "ifup $IFACE=$WPA_LOGICAL_IFACE"
>
> - if grep --quiet "^$WPA_IFACE=$WPA_IFACE"
> "$IFSTATE_FILE"; then
> + if grep --quiet "^$IFACE=$IFACE"
> "$IFSTATE_FILE"; then
> # Force settings over the unconfigured
> "master" IFACE
> - /sbin/ifup --force
> "$WPA_IFACE=$WPA_LOGICAL_IFACE"
> + /sbin/ifup --force
> "$IFACE=$WPA_LOGICAL_IFACE"
> else
> - /sbin/ifup "$WPA_IFACE=$WPA_LOGICAL_IFACE"
> + /sbin/ifup "$IFACE=$WPA_LOGICAL_IFACE"
> fi
> else
> echo "No network defined for
> \"$WPA_LOGICAL_IFACE\" in \"$INTERFACES_FILE\""
>
>
>
> Any thoughts?
> It works just as I wanted, but am I barking up the wrong tree?
I think this patch works, but modifies wpa_action in a way it is clearly not
intended to be.
When wpa_supplicant experiences a CONNECTED|DISCONNECTED event it executes
an action script like: <script> <interface> <event>, and wpa_cli sets a few env
variables at that time too.
When <interface> is in a bridge do we always want to act on the bridge and not
the interface? If this is always the case should wpa_supplicant supply the
bridge interface name as argument when it is started with the bridge option?
If not, we should make this somehow adjustable.
One way would be to have WPA_BRIDGE variable set by wpa_cli at script execution
time, as it does for WPA_ID and WPA_CTRL_DIR, rather than to rely on
environment variables inherited from daemon start time. Otherwise, the script
could check IF_WPA_BRIDGE before ignoring the arguments wpa_cli gave it and
using IFACE environment variable that is set only at daemon start time.
Thanks, Kel.
More information about the Pkg-wpa-devel
mailing list