roaming interfaces not configured after use of mapping in interfaces(5)

Bug #1262874 reported by Steve Dodd
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
wpasupplicant (Ubuntu)
New
Undecided
Unassigned

Bug Description

I'm running 12.10 on a mostly headless MK808 stick - but I believe this bug will exist on later versions as well as the code in question hasn't changed. Originally I had my /etc/network/interfaces configured to use wpa_supplicant in roaming mode, and this worked correctly. Then I needed to add an option to boot into hotspot mode, which I implemented using a flag file and a custom mapping script. After doing this, however, my roaming interfaces were not configured. Here is /etc/network/interfaces:

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

auto eth0
mapping eth0
 script /usr/local/bin/hotspot-req.sh
 map true host
 map false wpa

iface host inet static
 pre-up /sbin/iwconfig eth0 power off
 pre-up /sbin/iwconfig eth0 mode Master || true
 pre-up /sbin/iwconfig eth0 essid KITCHEN1
 address 192.168.150.1
 netmask 255.255.255.0

iface wpa inet manual
 wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
 wpa-debug-level 3
 pre-up /sbin/iwconfig eth0 power off

iface kitchen inet dhcp
 pre-up /sbin/iwconfig eth0 power off

iface home inet dhcp
 pre-up /sbin/iwconfig eth0 power off

The problem seems to be that ifup is not invoked with --force, although it apparently needs to be. The test is performed in this line of /etc/wpa_supplicant/functions.sh:

               if [ -n "$IFSTATE_FILE" ] && grep -q "^$WPA_IFACE=$WPA_IFACE" "$IFSTATE_FILE"; then

Changing it to:

              if [ -n "$IFSTATE_FILE" ] && grep -q "^$WPA_IFACE=" "$IFSTATE_FILE" && ! grep -q "^$WPA_IFACE=$WPA_LOGICAL_IFACE";
then

fixes my problem but I would like some thoughts on whether this is correct. The idea is if that physical interface is already configured, but not using the current logical interface name, then it needs to be forcibly reconfigured...
---
ApportVersion: 2.6.1-0ubuntu13
Architecture: armhf
DistroRelease: Ubuntu 12.10
MarkForUpload: True
Package: wpasupplicant 1.0-2ubuntu5
PackageArchitecture: armhf
ProcEnviron:
 TERM=screen.linux
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
Tags: quantal
Uname: Linux 3.0.8+ armv7l
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups:

mtime.conffile..etc.wpa.supplicant.functions.sh: 2013-12-19T21:42:06.469364

Revision history for this message
Steve Dodd (anarchetic) wrote :
Revision history for this message
Steve Dodd (anarchetic) wrote : Dependencies.txt

apport information

tags: added: apport-collected quantal
description: updated
Revision history for this message
Steve Dodd (anarchetic) wrote : modified.conffile..etc.wpa.supplicant.functions.sh.txt

apport information

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

The attachment "Always reconfigure physical if it wasn't reconfigured under this logical ifname" 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
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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