wpa-roam does not support logical "master" interfaces

Bug #1545363 reported by Paul Donohue
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
wpa (Debian)
Fix Released
Unknown
wpa (Ubuntu)
Fix Released
Low
Paul Donohue

Bug Description

There are situations where I have multiple APs (living on separate networks) in range simultaneously and I need to be able to manually choose between them (to manually move between those separate networks).

To handle this, I have multiple wpa_supplicant config files for each of the APs, and I use logical interfaces in /etc/network/interfaces to select the appropriate config file. For example:
iface public inet manual
  wpa-conf /etc/wpa_supplicant/public.conf
iface private inet manual
  wpa-conf /etc/wpa_supplicant/private.conf
To select the appropriate AP, I simply run `ifup wlan0=public` or `ifup wlan0=private`. This part works fine.

However, I would like to change the "wpa-conf" lines in the above example to use "wpa-roam" instead, so I can also handle roaming in conjunction with multiple wpa_supplicant config files. Unfortunately this doesn't work. When the "master" interface is already using a logical interface in /etc/network/interfaces, wpa-roam fails to load the logical interface specified by id_str.

The problem is that the ifup() function in functions.sh runs `grep -q "^$WPA_IFACE=$WPA_IFACE" "$IFSTATE_FILE"` to determine if the interface is already up, then runs /sbin/ifup either with or without '--force' depending on whether the interface is "up". If the "master" interface is defined in /etc/network/interfaces as a logical interface rather than a physical interface, then grep will not match, '--force' will not be used, and /sbin/ifup will fail because the interface is already configured and '--force' was not used.

The attached patch fixes this issue by running `ifquery` to determine whether the physical interface is currently configured as a wpasupplicant "master" interface and needs the '--force' argument to /sbin/ifup.

Tags: patch
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Paul Donohue (s-launchpad-paulsd-com) wrote :
description: updated
Mathew Hodson (mhodson)
Changed in wpa (Ubuntu):
importance: Undecided → Low
Revision history for this message
Iain Lane (laney) wrote :

Hi Paul, thanks for your patch! This particular code is maintained in Debian - is there any chance you could forward it there to see what the maintainers have to say?

  https://www.debian.org/Bugs/Reporting

Cheers

Revision history for this message
Iain Lane (laney) wrote :

I'm making this "Incomplete" to get it off the sponsor list. If you don't get any luck there, please reset to "New" again.

Changed in wpa (Ubuntu):
status: New → Incomplete
Revision history for this message
Dariusz Gadomski (dgadomski) wrote :

Paul, the patch looks good.

It's better than making those scripts compatible with new style of ifstate. Fixing ifstate-based implementation would not cover replacing one logical iface with another, while your implementation does it.

Good luck with pushing this to Debian.

Revision history for this message
Paul Donohue (s-launchpad-paulsd-com) wrote :
Changed in wpa (Debian):
status: Unknown → New
Revision history for this message
Martin Pitt (pitti) wrote :

Sponsored with a proper changelog.

Changed in wpa (Ubuntu):
assignee: nobody → Paul Donohue (s-launchpad-paulsd-com)
status: Incomplete → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package wpa - 2.4-0ubuntu7

---------------
wpa (2.4-0ubuntu7) yakkety; urgency=medium

  * debian/ifupdown/functions.sh: Fix handling for "wpa-roam". Call ifquery
    instead of directly parsing /run/*/ifstate files to work with current
    ifupdown. (Closes: #545766, LP: #1545363)

 -- Paul Donohue <email address hidden> Fri, 01 Jul 2016 09:16:21 +0200

Changed in wpa (Ubuntu):
status: Fix Committed → Fix Released
Changed in wpa (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Patches

Remote bug watches

Bug watches keep track of this bug in other bug trackers.