NetBSD Problem Report #45505

From www@NetBSD.org  Thu Oct 20 07:12:27 2011
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id E57EC63D5EB
	for <gnats-bugs@gnats.NetBSD.org>; Thu, 20 Oct 2011 07:12:26 +0000 (UTC)
Message-Id: <20111020071225.C8DC963D517@www.NetBSD.org>
Date: Thu, 20 Oct 2011 07:12:25 +0000 (UTC)
From: rm@gnu.org
Reply-To: rm@gnu.org
To: gnats-bugs@NetBSD.org
Subject: bge0 does not not clear its routes when downed
X-Send-Pr-Version: www-1.0

>Number:         45505
>Category:       kern
>Synopsis:       bge0 does not not clear its routes when downed
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Oct 20 07:15:00 +0000 2011
>Closed-Date:    Tue Jun 16 09:16:51 +0000 2020
>Last-Modified:  Tue Jun 16 09:16:51 +0000 2020
>Originator:     Riccardo
>Release:        5.99.56
>Organization:
GNUstep
>Environment:
NetBSD grid 5.99.56 NetBSD 5.99.56 (nc6120) #2: Tue Oct 18 11:08:54 CEST 2011  root@grid:/usr/obj/sys/arch/i386/compile/nc6120 i386

>Description:
iwi0 does not always come up properly.

#!/bin/sh
ifconfig bge0 down
route delete default
ifconfig iwi0 ssid xxxxxxxx
ifconfig iwi0 nwkey 0xYYYYYYYYY
dhclient iwi0 

Obtains a valid IP, but the network remains down.
grid$ ping www.netbsd.org
ping: Cannot resolve "www.netbsd.org" (Host name lookup failure)

grid$ ping 192.168.1.254
PING 192.168.1.254 (192.168.1.254): 52 data bytes
ping: sendto: Network is down
ping: sendto: Network is down 

After running the above script, "ifconfig iwi0" says:
iwi0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        ssid xxxxxxxx nwkey 0xXXXXXXXX
        powersave off
        bssid 94:0c:6d:f7:a4:9c chan 6
        address: 00:15:00:38:b1:9e
        media: IEEE802.11 autoselect
        status: active
        inet 192.168.1.156 netmask 0xffffff00 broadcast 255.255.255.255
        inet6 fe80::215:ff:fe38:b19e%iwi0 prefixlen 64 scopeid 0x1

netstat -r


Destination        Gateway            Flags    Refs      Use    Mtu Interface
default            192.168.1.254      UGS         0        0      -  iwi0
127/8              localhost          UGRS        0        0  33192  lo0
localhost          localhost          UH          2        0  33192  lo0
192.168.1/24       link#3             UC          1        0      -  bge0
192.168.1.156      localhost          UGHS        0        0  33192  lo0
192.168.1.254      00:30:0a:0b:75:7e  UHLc        1       36      -  bge0


dmesg:
iwi0 at pci2 dev 4 function 0: vendor 0x8086 product 0x4220 (rev. 0x05)
iwi0: interrupting at ioapic0 pin 21
iwi0: 802.11 address 00:15:00:38:b1:9e
iwi0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
iwi0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps 
>How-To-Repeat:
I have one network where this happens consistently: On another network, which has the same key/essid so I run the same script, but different Ip ranges, it works.
>Fix:

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: port-i386-maintainer->kern-bug-people
Responsible-Changed-By: dholland@NetBSD.org
Responsible-Changed-When: Sat, 05 Nov 2011 17:47:09 +0000
Responsible-Changed-Why:
machine-independent until proven otherwise


From: Riccardo Mottola <riccardo.mottola@libero.it>
To: gnats-bugs@NetBSD.org
Cc: dholland@NetBSD.org, kern-bug-people@netbsd.org, 
 port-i386-maintainer@netbsd.org, netbsd-bugs@netbsd.org, 
 gnats-admin@netbsd.org
Subject: Re: kern/45505 (iwi0 does not come up correctly)
Date: Mon, 12 Dec 2011 09:31:46 +0100

 Hi,

 the problem is the remaining route to the wired ethernet:

 192.168.1/24       link#3             UC          1        0      -  bge0


 if this route is deleted, wireless works. I point out that the wired 
 ethernet bge0 is not connected, the default route is deleted before.
 This is not a behaviour I get from other operating systems (FreeBSD, 
 Linux...), but it restricts the problem and offers a workaround.

 Riccardo

 On 11/05/11 18:47, dholland@NetBSD.org wrote:
 > Synopsis: iwi0 does not come up correctly
 >
 > Responsible-Changed-From-To: port-i386-maintainer->kern-bug-people
 > Responsible-Changed-By: dholland@NetBSD.org
 > Responsible-Changed-When: Sat, 05 Nov 2011 17:47:09 +0000
 > Responsible-Changed-Why:
 > machine-independent until proven otherwise
 >
 >
 >

From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/45505 (iwi0 does not come up correctly)
Date: Mon, 12 Dec 2011 14:55:51 +0000

 On Mon, Dec 12, 2011 at 09:45:01AM +0000, Riccardo Mottola wrote:
  >  Hi,
  >  
  >  the problem is the remaining route to the wired ethernet:
  >  
  >  192.168.1/24       link#3             UC          1        0      -  bge0
  >  
  >  
  >  if this route is deleted, wireless works. I point out that the wired 
  >  ethernet bge0 is not connected, the default route is deleted before.
  >  This is not a behaviour I get from other operating systems (FreeBSD, 
  >  Linux...), but it restricts the problem and offers a workaround.

 So, let me make sure I understand... you were using bge0 on
 192.168.1/24 and disconnected it, then brought up iwi0 also on
 192.168.1/24, but the above route was still present and therefore all
 traffic got sent to bge0?

 When you disconnected bge0 did you do "ifconfig down" on it?

 -- 
 David A. Holland
 dholland@netbsd.org

From: Riccardo Mottola <riccardo.mottola@libero.it>
To: gnats-bugs@NetBSD.org
Cc: David Holland <dholland-bugs@netbsd.org>, kern-bug-people@netbsd.org, 
 gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, rm@gnu.org
Subject: Re: kern/45505 (iwi0 does not come up correctly)
Date: Mon, 12 Dec 2011 16:05:21 +0100

 Hi David,

 David Holland wrote:
 >   So, let me make sure I understand... you were using bge0 on
 >   192.168.1/24 and disconnected it, then brought up iwi0 also on
 >   192.168.1/24, but the above route was still present and therefore all
 >   traffic got sent to bge0?
 >
 >   When you disconnected bge0 did you do "ifconfig down" on it?
 >
 Almost. I do power up the computer with a statically configured bge0, 
 but I never connect a cable to it. I do explicitely "down" it though. I 
 run the following script:

 #!/bin/sh
 ifconfig bge0 down
 route delete default
 ifconfig iwi0 ssid XXXXXXX
 ifconfig iwi0 nwkey 0xXXXXXXX
 dhclient iwi0

 Riccardo

From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/45505 (iwi0 does not come up correctly)
Date: Sun, 22 Jan 2012 16:29:54 +0000

 On Mon, Dec 12, 2011 at 03:10:06PM +0000, Riccardo Mottola wrote:
  >  >   So, let me make sure I understand... you were using bge0 on
  >  >   192.168.1/24 and disconnected it, then brought up iwi0 also on
  >  >   192.168.1/24, but the above route was still present and therefore all
  >  >   traffic got sent to bge0?
  >  >
  >  >   When you disconnected bge0 did you do "ifconfig down" on it?
  >
  >  Almost. I do power up the computer with a statically configured bge0, 
  >  but I never connect a cable to it. I do explicitely "down" it though. I 
  >  run the following script:
  >  
  >  #!/bin/sh
  >  ifconfig bge0 down
  >  route delete default
  >  ifconfig iwi0 ssid XXXXXXX
  >  ifconfig iwi0 nwkey 0xXXXXXXX
  >  dhclient iwi0

 AIUI downing the interface should remove its link-level route. If this
 is not happening, it should be easy to confirm, and it should be
 possible to work around the problem by nuking the route explicitly in
 that script.

 As to why it might not be happening... probably someone who knows more
 about the network code needs to investigate.

 -- 
 David A. Holland
 dholland@netbsd.org

From: Riccardo Mottola <rm@gnu.org>
To: gnats-bugs@NetBSD.org
Cc: David Holland <dholland-bugs@netbsd.org>, kern-bug-people@netbsd.org, 
 gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: kern/45505 (iwi0 does not come up correctly)
Date: Sun, 22 Jan 2012 19:48:08 +0100

 Hi,

 I can confirm that nuking it explicitely in the script, that is by 
 having it do:

 route delete default
 route delete 192.168.1.0
 ifconfig bge0 down

 gets wireless working.

 Riccardo

 On 01/22/12 17:30, David Holland wrote:
 > The following reply was made to PR kern/45505; it has been noted by GNATS.
 >
 > From: David Holland<dholland-bugs@netbsd.org>
 > To: gnats-bugs@NetBSD.org
 > Cc:
 > Subject: Re: kern/45505 (iwi0 does not come up correctly)
 > Date: Sun, 22 Jan 2012 16:29:54 +0000
 >
 >   On Mon, Dec 12, 2011 at 03:10:06PM +0000, Riccardo Mottola wrote:
 >    >   >    So, let me make sure I understand... you were using bge0 on
 >    >   >    192.168.1/24 and disconnected it, then brought up iwi0 also on
 >    >   >    192.168.1/24, but the above route was still present and therefore all
 >    >   >    traffic got sent to bge0?
 >    >   >
 >    >   >    When you disconnected bge0 did you do "ifconfig down" on it?
 >    >
 >    >   Almost. I do power up the computer with a statically configured bge0,
 >    >   but I never connect a cable to it. I do explicitely "down" it though. I
 >    >   run the following script:
 >    >
 >    >   #!/bin/sh
 >    >   ifconfig bge0 down
 >    >   route delete default
 >    >   ifconfig iwi0 ssid XXXXXXX
 >    >   ifconfig iwi0 nwkey 0xXXXXXXX
 >    >   dhclient iwi0
 >
 >   AIUI downing the interface should remove its link-level route. If this
 >   is not happening, it should be easy to confirm, and it should be
 >   possible to work around the problem by nuking the route explicitly in
 >   that script.
 >
 >   As to why it might not be happening... probably someone who knows more
 >   about the network code needs to investigate.
 >
 >   --
 >   David A. Holland
 >   dholland@netbsd.org
 >


 -- 
 ---
 GNUstep maintainer and Application developer

From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/45505: bge0 does not not clear its routes when downed
Date: Sun, 22 Jan 2012 19:05:35 +0000

 On Sun, Jan 22, 2012 at 06:50:05PM +0000, Riccardo Mottola wrote:
  >  I can confirm that nuking it explicitely in the script, that is by 
  >  having it do:
  >  
  >  route delete default
  >  route delete 192.168.1.0
  >  ifconfig bge0 down
  >  
  >  gets wireless working.

 Thanks.

 I've updated the Synopsis: to match where the problem is, and with
 luck someone who knows that code will come along and look into it.

 -- 
 David A. Holland
 dholland@netbsd.org

From: Roy Marples <roy@marples.name>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/45505 (iwi0 does not come up correctly)
Date: Tue, 16 Jun 2020 10:13:00 +0100

 This isn't a bug with the kernel.
 There is no expectation that routes should be cleared when the interface goes dow.

 dhcpcd(8) on the other hand when running in master mode, will *change* the route 
 if it can to an active interface.

 Assuming bge0 and iwi0 are on the same network if you take bge0 down or unplug 
 the cable, the subnet routes will be moved to iwi0.
 When you plug the cable back in or bring bge0 up the subnet routes will be moved 
 back to the bge0 interface.

 Roy

State-Changed-From-To: open->closed
State-Changed-By: roy@NetBSD.org
State-Changed-When: Tue, 16 Jun 2020 09:16:51 +0000
State-Changed-Why:
Not A Bug


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: gnats-precook-prs,v 1.4 2018/12/21 14:20:20 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.