Bug#647955: ifplugd: Plug in cable while on wireless - no default route

2011-12-10 Thread Brian Potkin
Package: ifplugd
Followup-For: Bug #647955


I'd be inclined to think this bug should be reassigned to wpasupplicant
as /etc/ifplugd/action.d/action_wpa is provided by that package. What
the reporter describes is also my experience but I'd not see ifplugd as
being at fault as it merely runs the scripts in /etc/ifplugd/action.d/.

My solution was to add

   # Wait for default route for IFACE to disappear.
   if [ ${COMMAND} = disconnect ] ; then
  X=$(ip route list | grep default | cut -d  -f5)
  while [ $X = ${IFACE} ]
 do
 X=$(ip route list | grep default | cut -d  -f5)
 done
   fi

to action_wpa after the line

   wpa_cli -i ${IFACE} ${COMMAND}

The code may not be great but it cures the problem and is a step up on
my original 'sleep 3'!



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#647955: ifplugd: Plug in cable while on wireless - no default route

2011-11-07 Thread Andrew Pimlott
Package: ifplugd
Version: 0.28-19
Severity: normal

Dear Maintainer,

I run ifplugd on my eth0 ethernet interface, and use wpa_supplicant for
my eth1 wireless interface.  When I am on wireless and plug in my
ethernet cable, I often (but not always) end up with a configured eth0
interface but no default route.  This happens due to a race condition
between eth1 going down and eth0 coming up.  I don't think this is
necesarily ifplugd's fault, but I file it here so you can help route it
to the right place.

Here is what happens:

1.  ifplugd detects the ethernet interface.
2.  ifplugd runs /etc/ifplugd/action.d/action_wpa.  This calls wpa_cli
-i eth1 disconnect, which takes down the eth1 interface asynchronously.
3.  ifplugd runs /etc/ifplugd/action.d/ifupdown.  This calls ifup eth0,
which brings up the eth0 interface using dhcp (in my configuration).
4.  When dhclient gets a lease, it calls /sbin/dhclient-script, which
calls something like

  ip -4 route add default via 192.168.1.1 dev eth0

Unfortunately, at this point, since eth1 was taken down
asynchronously, it may still have the default route.  When this
command is run while eth1 has the default route, it fails with

  RTNETLINK answers: File exists

I can think of three possible solutions:

- wpasupplicant provides a synchronous call to take down the interface.
- ifplugd polls for the wireless interfaces to finish going down.
- isc-dhcp-client enables setting multiple default routes, so eth0 and
  eth1 both have default routes for the brief period where they coexist.

The last of these seems most logical to me, but from what I understand
it may be difficult to configure.  Maybe isc-dhcp-client could take over
the default route unconditionally.

Anyhow, I would appreciate your advice.

Andrew

-- Package-specific info:
 /sys/class/net/ interfaces:
/sys/class/net/eth0/
/sys/class/net/eth1/
/sys/class/net/lo/

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 3.0.0-1-486
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages ifplugd depends on:
ii  debconf [debconf-2.0]  1.5.41 
ii  libc6  2.13-21
ii  libdaemon0 0.14-2 
ii  lsb-base   3.2-28 

Versions of packages ifplugd recommends:
ii  ifupdown  0.7~alpha5+really0.6.16

Versions of packages ifplugd suggests:
ii  wpasupplicant  0.7.3-5

-- debconf information:
* ifplugd/interfaces: eth0
* ifplugd/hotplug_interfaces:
* ifplugd/args: -f -u0 -d10 -w -I --no-beep
* ifplugd/suspend_action: stop



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#647955: ifplugd: Plug in cable while on wireless - no default route

2011-11-07 Thread Andrew Pimlott
Log (daemon.log) for a problem case.  Note the interleaving of eth0 and
eth1 events.

Nov  7 14:07:27 apple ifplugd(eth0)[27270]: Link beat detected.
Nov  7 14:07:27 apple ifplugd(eth0)[27270]: Executing 
'/etc/ifplugd/ifplugd.action eth0 up'.
Nov  7 14:07:27 apple ifplugd(eth0)[27270]: client: OK
Nov  7 14:07:27 apple wpa_supplicant[1536]: CTRL-EVENT-DISCONNECTED 
bssid=00:00:00:00:00:00 reason=0
Nov  7 14:07:28 apple dhclient: Internet Systems Consortium DHCP Client 4.2.2
Nov  7 14:07:28 apple ifplugd(eth0)[27270]: client: Internet Systems Consortium 
DHCP Client 4.2.2
Nov  7 14:07:28 apple dhclient: Copyright 2004-2011 Internet Systems Consortium.
Nov  7 14:07:28 apple ifplugd(eth0)[27270]: client: Copyright 2004-2011 
Internet Systems Consortium.
Nov  7 14:07:28 apple dhclient: All rights reserved.
Nov  7 14:07:28 apple ifplugd(eth0)[27270]: client: All rights reserved.
Nov  7 14:07:28 apple dhclient: For info, please visit 
https://www.isc.org/software/dhcp/
Nov  7 14:07:28 apple ifplugd(eth0)[27270]: client: For info, please visit 
https://www.isc.org/software/dhcp/
Nov  7 14:07:28 apple dhclient: 
Nov  7 14:07:28 apple dhclient: Listening on LPF/eth0/00:0a:e4:26:95:59
Nov  7 14:07:28 apple dhclient: Sending on   LPF/eth0/00:0a:e4:26:95:59
Nov  7 14:07:28 apple dhclient: Sending on   Socket/fallback
Nov  7 14:07:28 apple dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 
interval 3
Nov  7 14:07:28 apple ifplugd(eth0)[27270]: client: Listening on 
LPF/eth0/00:0a:e4:26:95:59
Nov  7 14:07:28 apple ifplugd(eth0)[27270]: client: Sending on   
LPF/eth0/00:0a:e4:26:95:59
Nov  7 14:07:28 apple ifplugd(eth0)[27270]: client: Sending on   Socket/fallback
Nov  7 14:07:28 apple ifplugd(eth0)[27270]: client: DHCPDISCOVER on eth0 to 
255.255.255.255 port 67 interval 3
Nov  7 14:07:28 apple dhclient: Internet Systems Consortium DHCP Client 4.2.2
Nov  7 14:07:28 apple dhclient: Copyright 2004-2011 Internet Systems Consortium.
Nov  7 14:07:28 apple dhclient: All rights reserved.
Nov  7 14:07:28 apple dhclient: For info, please visit 
https://www.isc.org/software/dhcp/
Nov  7 14:07:28 apple dhclient: 
Nov  7 14:07:28 apple dhclient: Listening on LPF/eth1/00:0c:f1:3e:02:61
Nov  7 14:07:28 apple dhclient: Sending on   LPF/eth1/00:0c:f1:3e:02:61
Nov  7 14:07:28 apple dhclient: Sending on   Socket/fallback
Nov  7 14:07:28 apple avahi-daemon[1906]: Joining mDNS multicast group on 
interface eth0.IPv6 with address fe80::20a:e4ff:fe26:9559.
Nov  7 14:07:28 apple avahi-daemon[1906]: New relevant interface eth0.IPv6 for 
mDNS.
Nov  7 14:07:28 apple avahi-daemon[1906]: Registering new address record for 
fe80::20a:e4ff:fe26:9559 on eth0.*.
Nov  7 14:07:28 apple dhclient: DHCPREQUEST on eth0 to 255.255.255.255 port 67
Nov  7 14:07:28 apple dhclient: DHCPOFFER from 192.168.1.1
Nov  7 14:07:28 apple ifplugd(eth0)[27270]: client: DHCPREQUEST on eth0 to 
255.255.255.255 port 67
Nov  7 14:07:28 apple ifplugd(eth0)[27270]: client: DHCPOFFER from 192.168.1.1
Nov  7 14:07:28 apple dhclient: DHCPACK from 192.168.1.1
Nov  7 14:07:28 apple ifplugd(eth0)[27270]: client: DHCPACK from 192.168.1.1
Nov  7 14:07:29 apple dhclient: DHCPRELEASE on eth1 to 192.168.1.1 port 67
Nov  7 14:07:29 apple ifplugd(eth0)[27270]: client: Reloading 
/etc/samba/smb.conf: smbd only.
Nov  7 14:07:29 apple avahi-daemon[1906]: Joining mDNS multicast group on 
interface eth0.IPv4 with address 192.168.1.146.
Nov  7 14:07:29 apple avahi-daemon[1906]: New relevant interface eth0.IPv4 for 
mDNS.
Nov  7 14:07:29 apple avahi-daemon[1906]: Registering new address record for 
192.168.1.146 on eth0.IPv4.
Nov  7 14:07:30 apple dhclient: bound to 192.168.1.146 -- renewal in 38019 
seconds.
Nov  7 14:07:30 apple ifplugd(eth0)[27270]: client: bound to 192.168.1.146 -- 
renewal in 38019 seconds.
Nov  7 14:07:30 apple avahi-daemon[1906]: Withdrawing address record for 
192.168.1.102 on eth1.
Nov  7 14:07:30 apple avahi-daemon[1906]: Leaving mDNS multicast group on 
interface eth1.IPv4 with address 192.168.1.102.
Nov  7 14:07:30 apple avahi-daemon[1906]: Interface eth1.IPv4 no longer 
relevant for mDNS.
Nov  7 14:07:30 apple avahi-daemon[1906]: Interface eth1.IPv6 no longer 
relevant for mDNS.
Nov  7 14:07:30 apple avahi-daemon[1906]: Leaving mDNS multicast group on 
interface eth1.IPv6 with address fe80::20c:f1ff:fe3e:261.
Nov  7 14:07:30 apple avahi-daemon[1906]: Withdrawing address record for 
fe80::20c:f1ff:fe3e:261 on eth1.

Andrew

Excerpts from Andrew Pimlott's message of Mon Nov 07 14:04:21 -0800 2011:
 Package: ifplugd
 Version: 0.28-19
 Severity: normal
 
 Dear Maintainer,
 
 I run ifplugd on my eth0 ethernet interface, and use wpa_supplicant for
 my eth1 wireless interface.  When I am on wireless and plug in my
 ethernet cable, I often (but not always) end up with a configured eth0
 interface but no default route.  This happens due to a race condition
 between eth1 going down and eth0 coming up.  I don't think this is
 necesarily ifplugd's fault, but I file it