NetBSD Problem Report #30694

From www@netbsd.org  Fri Jul  8 12:26:48 2005
Return-Path: <www@netbsd.org>
Received: by narn.netbsd.org (Postfix, from userid 31301)
	id 10E4763B104; Fri,  8 Jul 2005 12:26:48 +0000 (UTC)
Message-Id: <20050708122648.10E4763B104@narn.netbsd.org>
Date: Fri,  8 Jul 2005 12:26:48 +0000 (UTC)
From: krille@users.sf.net
Reply-To: krille@users.sf.net
To: gnats-bugs@netbsd.org
Subject: ifconfig(8) brings the interface up when assigning an IP, even when "down" is also specified
X-Send-Pr-Version: www-1.0

>Number:         30694
>Category:       bin
>Synopsis:       ifconfig(8) brings the interface up when assigning an IP, even when "down" is also specified
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    martin
>State:          analyzed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jul 08 12:27:00 +0000 2005
>Closed-Date:    
>Last-Modified:  Sun Oct 14 05:55:00 +0000 2007
>Originator:     Christian Hattemer
>Release:        3.0_BETA
>Organization:
>Environment:
NetBSD lahksa 3.0_BETA NetBSD 3.0_BETA (SPARC-TEST) #0: Wed Jun 15 16:21:50 CEST 2005
>Description:
Sometimes you want to configure an interface completly including assigning an IP, but keep it down. E. g. prepare a pppoe interface to go up on demand later.

But it will always go up when assigning the IP and ignore the "down" parameter.

It turns out that ifconfig pretends to work as expected in 2.0. However it archives that by setting the interface down again after it has come up. Since this isn't the correct way this code was removed again shortly after 2.0 was branched.

See Rev. 1.142 of src/sbin/ifconfig/ifconfig.c for that.


PS: I'm going on vacation for two weeks this afternoon.
>How-To-Repeat:
# ifconfig le0
le0: flags=8862<BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        address: 00:40:dc:01:04:d6
        media: Ethernet autoselect
# ifconfig le0 192.168.5.5 down
# ifconfig le0
le0: flags=8863<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        address: 00:40:dc:01:04:d6
        media: Ethernet autoselect (10baseT)
        status: active
        inet 192.168.5.5 netmask 0xffffff00 broadcast 192.168.5.255

>Fix:
As that log message of the above mentioned revision states:
"If we don't want the kernel to automatically bring up interfaces, then we should move that code into ifconfig(8) and out of the kernel, not cycle the interface up and down."

>Release-Note:

>Audit-Trail:
From: Martin Husemann <martin@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: PR/30694 CVS commit: src/sbin/ifconfig
Date: Thu, 13 Jul 2006 14:02:03 +0000 (UTC)

 Module Name:	src
 Committed By:	martin
 Date:		Thu Jul 13 14:02:03 UTC 2006

 Modified Files:
 	src/sbin/ifconfig: ifconfig.c

 Log Message:
 Trying the old "ifconfig <name> x.x.x.x down" issue again:
 if the kernel does not set the interface up after we set an address,
 do it explicitly, unless we (previously) set it down on user request.

 This will allow the network drivers to be "fixed" while keeping visible
 behaviour the same. Part of fixing PR 30694.


 To generate a diff of this commit:
 cvs rdiff -r1.172 -r1.173 src/sbin/ifconfig/ifconfig.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Martin Husemann <martin@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: PR/30694 CVS commit: src/sys/net
Date: Thu, 13 Jul 2006 14:04:50 +0000 (UTC)

 Module Name:	src
 Committed By:	martin
 Date:		Thu Jul 13 14:04:50 UTC 2006

 Modified Files:
 	src/sys/net: if_spppsubr.c

 Log Message:
 Do not automagically UP the interface when setting the address.
 Together with previous ifconfig changes, this fixes PR 30694, at
 least for pppoe (and other sppp based) interfaces.


 To generate a diff of this commit:
 cvs rdiff -r1.92 -r1.93 src/sys/net/if_spppsubr.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

Responsible-Changed-From-To: bin-bug-people->martin
Responsible-Changed-By: martin@netbsd.org
Responsible-Changed-When: Thu, 13 Jul 2006 14:06:29 +0000
Responsible-Changed-Why:
I'll handle it


State-Changed-From-To: open->analyzed
State-Changed-By: martin@netbsd.org
State-Changed-When: Thu, 13 Jul 2006 14:06:29 +0000
State-Changed-Why:
I have a (partial) fix


From: "Liam J. Foy" <liamjfoy@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: PR/30694 CVS commit: [netbsd-3] src/sys/net
Date: Fri, 15 Jun 2007 11:37:59 +0000 (UTC)

 Module Name:	src
 Committed By:	liamjfoy
 Date:		Fri Jun 15 11:37:59 UTC 2007

 Modified Files:
 	src/sys/net [netbsd-3]: if_spppsubr.c

 Log Message:
 Pull up following revision(s) (requested by msaitoh in ticket #1802):
 	sys/net/if_spppsubr.c                           1.93-1.94

 	Do not automagically UP the interface when setting the address.
 	This is the interface level (e.g. pppoe) fix for PR 30694.


 To generate a diff of this commit:
 cvs rdiff -r1.82.2.1 -r1.82.2.2 src/sys/net/if_spppsubr.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Jeff Rizzo <riz@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: PR/30694 CVS commit: [netbsd-3] src/sbin/ifconfig
Date: Sun, 14 Oct 2007 05:54:36 +0000 (UTC)

 Module Name:	src
 Committed By:	riz
 Date:		Sun Oct 14 05:54:36 UTC 2007

 Modified Files:
 	src/sbin/ifconfig [netbsd-3]: ifconfig.c

 Log Message:
 Pull up following revision(s) (requested by msaitoh in ticket #1801):
 	sbin/ifconfig/ifconfig.c: revision 1.173 via patch

         If the kernel does not set the interface up after we set an address,
         do it explicitly, unless we (previously) set it down on user request
         (i.e. "ifconfig <name> x.x.x.x down").

         This will allow the network drivers to be "fixed" while keeping visible
         behaviour the same. Part of fixing PR 30694.


 To generate a diff of this commit:
 cvs rdiff -r1.152.2.1 -r1.152.2.2 src/sbin/ifconfig/ifconfig.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.