NetBSD Problem Report #46579

From t-hash@abox3.so-net.ne.jp  Mon Jun 11 00:50:52 2012
Return-Path: <t-hash@abox3.so-net.ne.jp>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	by www.NetBSD.org (Postfix) with ESMTP id BDA7663B882
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 11 Jun 2012 00:50:52 +0000 (UTC)
Message-Id: <201206110050.q5B0okwm021339@mx61.ms.so-net.ne.jp>
Date: Mon, 11 Jun 2012 09:50:47 +0900
From: Takahiro HAYASHI <t-hash@abox3.so-net.ne.jp>
To: gnats-bugs@gnats.NetBSD.org
Subject: ifconfig prints unnecessary message when deleting interface

>Number:         46579
>Category:       bin
>Synopsis:       ifconfig prints unnecessary message when deleting interface
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jun 11 00:55:00 +0000 2012
>Closed-Date:    Sat Nov 02 18:18:40 +0000 2013
>Last-Modified:  Sat Nov 02 18:18:40 +0000 2013
>Originator:     Takahiro HAYASHI
>Release:        NetBSD 6.99.7
>Organization:
>Environment:
System: NetBSD ruin 6.99.7 NetBSD 6.99.7 (MONOLITHIC) #0: Sun May 27 10:16:46 UTC 2012  builds@b6.netbsd.org:/home/builds/ab/HEAD/i386/201205270250Z-obj/home/builds/ab/HEAD/src/sys/arch/i386/compile/MONOLITHIC i386
Architecture: i386
Machine: i386
>Description:
ifconfig(8) prints out unnecessary message and exits with 1 when
deleting interface.  The exit value `1' in such case is wrong
because the specified interface has been removed successfully.

# ifconfig tap0 create
# echo $?
0
# ifconfig tap0 destroy
tap0: detached
ifconfig: commit_address: getifinfo: Device not configured
# echo $?
1
# ifconfig tap0
ifconfig: SIOCGIFFLAGS tap0: Device not configured
# echo $?
1
# 

It works correctly before rev 1.15 of src/sbin/ifconfig/af_inetany.c.

# ifconfig tap0 create
# echo $?
0
# ifconfig tap0 destroy
tap0: detached
# echo $?
0
# ifconfig tap0
ifconfig: SIOCGIFFLAGS tap0: Device not configured
# echo $?
1
# 

>How-To-Repeat:
Please see Description.
>Fix:
No idea.


>Release-Note:

>Audit-Trail:
From: =?UTF-8?B?546L5piO5ZOy?= <wmzhere@gmail.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/46579: ifconfig prints unnecessary message when deleting interface
Date: Sat, 29 Dec 2012 22:26:41 +0800

 --e89a8f3bad0f9853c404d1fe91ef
 Content-Type: multipart/alternative; boundary=e89a8f3bad0f9853c004d1fe91ed

 --e89a8f3bad0f9853c004d1fe91ed
 Content-Type: text/plain; charset=UTF-8

 This is the bug fix for bin.46579.

 Detail:
 When the interface is destroyed, ifconfig doesn't quit immediately. It
 tries to configure it instead, like the most common usage. Because the
 interface is destroyed, errors occur when opening the device.

 -- 
 Mingzhe Wang

 --e89a8f3bad0f9853c004d1fe91ed
 Content-Type: text/html; charset=UTF-8
 Content-Transfer-Encoding: quoted-printable

 <div dir=3D"ltr">This is the bug fix for bin.46579.=C2=A0<div><br></div><di=
 v style>Detail:</div><div>When the interface is destroyed, ifconfig doesn&#=
 39;t quit immediately. It tries to configure it instead, like the most comm=
 on usage. Because the interface is destroyed, errors occur when opening the=
  device.<br clear=3D"all">
 <div><br></div>-- <br><div style=3D"text-align:left"><span></span>Mingzhe W=
 ang</div>
 </div></div>

 --e89a8f3bad0f9853c004d1fe91ed--
 --e89a8f3bad0f9853c404d1fe91ef
 Content-Type: application/octet-stream; name="ifconfig.diff"
 Content-Disposition: attachment; filename="ifconfig.diff"
 Content-Transfer-Encoding: base64
 X-Attachment-Id: f_hbaubc5x0

 SW5kZXg6IGlmY29uZmlnLmMKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
 PT09PT09PT09PT09PT09PT09PT09PT09PT09PQpSQ1MgZmlsZTogL2N2c3Jvb3Qvc3JjL3NiaW4v
 aWZjb25maWcvaWZjb25maWcuYyx2CnJldHJpZXZpbmcgcmV2aXNpb24gMS4yMjgKZGlmZiAtdSAt
 YSAtcjEuMjI4IGlmY29uZmlnLmMKLS0tIGlmY29uZmlnLmMJMSBOb3YgMjAxMiAxMzo0MzoyMyAt
 MDAwMAkxLjIyOAorKysgaWZjb25maWcuYwkyNSBEZWMgMjAxMiAxMDowMToyNCAtMDAwMApAQCAt
 ODY2LDYgKzg2NiwxMSBAQAogCQl3YXJuKCIlcyIsIF9fZnVuY19fKTsKIAkJcmV0dXJuIC0xOwog
 CX0KKworCWlmIChjbWQgPT0gU0lPQ0lGREVTVFJPWSkgeworCQkvKiBJZiB0aGUgaW50ZXJmYWNl
 IGlzIGRlc3Ryb3llZCwgbm8gc2V0dGluZ3MgbmVlZHMgdG8gYXBwbHkuICovCisJCWV4aXQoRVhJ
 VF9TVUNDRVNTKTsKKwl9CiAJcmV0dXJuIDA7CiB9CiAK
 --e89a8f3bad0f9853c404d1fe91ef--

From: Julian Djamil Fagir <gnrp@komkon2.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/46579: ifconfig prints unnecessary message when deleting
 interface
Date: Sun, 30 Dec 2012 23:16:35 +0100

 --MP_/NUYn1jRj5Lb3CVeOSISdgkf
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: inline

 Hi,

 this is a student from GCi. I append the original patch he proposed, somehow
 Google Mail ate the encoding.

 On Sat, 29 Dec 2012 14:30:13 +0000 (UTC) =E7=8E=8B=E6=98=8E=E5=93=B2 wrote:
 > The following reply was made to PR bin/46579; it has been noted by GNATS.
 >  This is the bug fix for bin.46579.
 > =20
 >  Detail:
 >  When the interface is destroyed, ifconfig doesn't quit immediately. It
 >  tries to configure it instead, like the most common usage. Because the
 >  interface is destroyed, errors occur when opening the device.

 Regards, Julian

 --MP_/NUYn1jRj5Lb3CVeOSISdgkf
 Content-Type: text/x-patch
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: attachment; filename=ifconfig.diff

 Index: ifconfig.c
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 RCS file: /cvsroot/src/sbin/ifconfig/ifconfig.c,v
 retrieving revision 1.228
 diff -u -a -r1.228 ifconfig.c
 --- ifconfig.c	1 Nov 2012 13:43:23 -0000	1.228
 +++ ifconfig.c	25 Dec 2012 10:01:24 -0000
 @@ -866,6 +866,11 @@
  		warn("%s", __func__);
  		return -1;
  	}
 +
 +	if (cmd =3D=3D SIOCIFDESTROY) {
 +		/* If the interface is destroyed, no settings needs to apply. */
 +		exit(EXIT_SUCCESS);
 +	}
  	return 0;
  }
 =20

 --MP_/NUYn1jRj5Lb3CVeOSISdgkf--

From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/46579 CVS commit: src/sbin/ifconfig
Date: Sun, 30 Dec 2012 17:50:43 -0500

 Module Name:	src
 Committed By:	christos
 Date:		Sun Dec 30 22:50:43 UTC 2012

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

 Log Message:
 PR/46579: Takahiro HAYASHI: ifconfig clone destroy should not print useless
 diagnostic and exit with an error code. Get the interface name and flags
 opportunistically to allow the code to return normally if it does not need
 to do anything.


 To generate a diff of this commit:
 cvs rdiff -u -r1.15 -r1.16 src/sbin/ifconfig/af_inetany.c

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

From: Takahiro HAYASHI <t-hash@abox3.so-net.ne.jp>
To: gnats-bugs@NetBSD.org
Cc: christos@zoulas.com (Christos Zoulas)
Subject: Re: PR/46579 CVS commit: src/sbin/ifconfig
Date: Thu, 24 Jan 2013 20:08:23 +0900

 Thank you for patching, Christos, and reminding this problem, Wang.

 BTW can you pullup this patch to netbsd-6 ?
 netbsd-6 has same code, same problem.

 On Sun, 30 Dec 2012 22:55:04 +0000 (UTC)
 "Christos Zoulas" <christos@netbsd.org> wrote:

 > The following reply was made to PR bin/46579; it has been noted by GNATS.
 > 
 > From: "Christos Zoulas" <christos@netbsd.org>
 > To: gnats-bugs@gnats.NetBSD.org
 > Cc: 
 > Subject: PR/46579 CVS commit: src/sbin/ifconfig
 > Date: Sun, 30 Dec 2012 17:50:43 -0500
 > 
 >  Module Name:	src
 >  Committed By:	christos
 >  Date:		Sun Dec 30 22:50:43 UTC 2012
 >  
 >  Modified Files:
 >  	src/sbin/ifconfig: af_inetany.c
 >  
 >  Log Message:
 >  PR/46579: Takahiro HAYASHI: ifconfig clone destroy should not print useless
 >  diagnostic and exit with an error code. Get the interface name and flags
 >  opportunistically to allow the code to return normally if it does not need
 >  to do anything.
 >  
 >  
 >  To generate a diff of this commit:
 >  cvs rdiff -u -r1.15 -r1.16 src/sbin/ifconfig/af_inetany.c
 >  
 >  Please note that diffs are not public domain; they are subject to the
 >  copyright notices on the relevant files.
 >  

 --
 t-hash

From: christos@zoulas.com (Christos Zoulas)
To: gnats-bugs@NetBSD.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, 
	Takahiro HAYASHI <t-hash@abox3.so-net.ne.jp>
Cc: 
Subject: Re: PR/46579 CVS commit: src/sbin/ifconfig
Date: Thu, 24 Jan 2013 08:27:51 -0500

 On Jan 24, 11:10am, t-hash@abox3.so-net.ne.jp (Takahiro HAYASHI) wrote:
 -- Subject: Re: PR/46579 CVS commit: src/sbin/ifconfig

 | The following reply was made to PR bin/46579; it has been noted by GNATS.

 Sent, thanks!

 christos

From: "Jeff Rizzo" <riz@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/46579 CVS commit: [netbsd-6] src/sbin/ifconfig
Date: Fri, 8 Feb 2013 22:41:29 +0000

 Module Name:	src
 Committed By:	riz
 Date:		Fri Feb  8 22:41:29 UTC 2013

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

 Log Message:
 Pull up following revision(s) (requested by christos in ticket #799):
 	sbin/ifconfig/af_inetany.c: revision 1.16
 PR/46579: Takahiro HAYASHI: ifconfig clone destroy should not print useless
 diagnostic and exit with an error code. Get the interface name and flags
 opportunistically to allow the code to return normally if it does not need
 to do anything.


 To generate a diff of this commit:
 cvs rdiff -u -r1.14 -r1.14.6.1 src/sbin/ifconfig/af_inetany.c

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

State-Changed-From-To: open->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sat, 02 Nov 2013 18:18:40 +0000
State-Changed-Why:
fix pulled up back in february


>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.