[pkg-wpa-devel] Bug#783650: wpasupplicant: Honor /etc/network/interfaces.d/ (or whatever directories are sourced in /etc/network/interfaces)

Jan-Benedict Glaw jbglaw at lug-owl.de
Tue Apr 28 18:05:43 UTC 2015


Package: wpasupplicant
Version: 2.3-2

Hi!

I configured wpasupplicant with a roaming interface:

root at odroid-c1-1:~# cat /etc/network/interfaces.d/wlan0 
auto wlan0
iface wlan0 inet manual
        wpa-driver      wext
        wpa-roam        /etc/wpa_supplicant/wpa_supplicant.conf
        wpa-verbosity   1


I configured one Wifi network in it's wpa_supplicant.conf and it is
joined. However, `dhclient' isn't started, because
/etc/wpa_supplicant/functions.sh:ifup() (sourced from
/sbin/wpa_action) does only look in /etc/network/interfaces, but
doesn't honor in directories configured there with the
"source-directory" directive.

  Modern systems may have something like
"source-directory /etc/network/interfaces.d", which allows to define
each interface in its own file. But since the simple parser doesn't
honor the fragment directory, is just replaces the correct network
name with `default':


/etc/wpa_supplicant/functions.sh:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 886 #####################################################################
 887 ## apply mapping logic and ifup logical interface
 888 # Apply mapping logic via id_str or external mapping script, check
 889 # state of IFACE with respect to ifupdown and ifup logical interaface
 890 #
 891 ifup () {
[...]
 944         if [ -n "$WPA_LOGICAL_IFACE" ]; then
 945                 if egrep -q "^iface[[:space:]]+${WPA_LOGICAL_IFACE}[[:space:]]+inet" "$INTERFACES_FILE"; then
 946                         : # logical network is defined
 947                 else
 948                         wpa_msg log "network settings not defined for $WPA_LOGICAL_IFACE in $INTERFACES_FILE"
 949                         WPA_LOGICAL_IFACE="default"
 950                 fi


Just omitting the check for whether or net the logical network is
defined will let it work. Unfortunately, the `functions.sh' predates
the current Debian packaging SVN, so I cannot figure out (easily) what
the intention was to set the logical iface name to "default".

  But after all, it would be nice to either broaden the check (to also
walk through additional files within directories mentioned with the
"source-directory" stanza, or so allow for some config item (along
with the base interfacee for which roaming is configured) to force the
original "id_str" name.

Thanks a lot,
  Jan-Benedict

-- 
      Jan-Benedict Glaw      jbglaw at lug-owl.de              +49-172-7608481
 Signature of:                            If it doesn't work, force it.
 the second  :                   If it breaks, it needed replacing anyway.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-wpa-devel/attachments/20150428/26e8dec1/attachment.sig>


More information about the Pkg-wpa-devel mailing list