From andre.albsmeier@mchp.siemens.de  Sat Sep 15 02:48:14 2001
Return-Path: <andre.albsmeier@mchp.siemens.de>
Received: from david.siemens.de (david.siemens.de [192.35.17.14])
	by hub.freebsd.org (Postfix) with ESMTP id 9A24437B40F
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 15 Sep 2001 02:48:13 -0700 (PDT)
Received: from mail2.siemens.de (mail2.siemens.de [139.25.208.11])
	by david.siemens.de (8.11.6/8.11.6) with ESMTP id f8F9mCS06093
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 15 Sep 2001 11:48:12 +0200 (MET DST)
Received: from curry.mchp.siemens.de (curry.mchp.siemens.de [139.25.42.7])
	by mail2.siemens.de (8.11.6/8.11.6) with ESMTP id f8F9mB013628
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 15 Sep 2001 11:48:11 +0200 (MET DST)
Received: (from localhost)
	by curry.mchp.siemens.de (8.11.6/8.11.6) id f8F9mBL94706
	for FreeBSD-gnats-submit@freebsd.org; Sat, 15 Sep 2001 11:48:11 +0200 (CEST)
Message-Id: <200109150948.f8F9mB803604@curry.mchp.siemens.de>
Date: Sat, 15 Sep 2001 11:48:11 +0200 (CEST)
From: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [PATCH] small fix to ifconfig output
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         30587
>Category:       bin
>Synopsis:       [PATCH] small fix to ifconfig output
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    yar
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Sep 15 02:50:01 PDT 2001
>Closed-Date:    Tue Nov 13 20:35:21 PST 2001
>Last-Modified:  Tue Nov 13 20:37:14 PST 2001
>Originator:     Andre Albsmeier
>Release:        FreeBSD 4.4-STABLE i386
>Organization:
>Environment:

System: FreeBSD 4.4-STABLE #0: Sat Sep 15 10:36:26 CEST 2001 

>Description:

ifconfig -a inserts a blank line in output if interface isn't active:

fxp0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet 192.168.128.1 netmask 0xffffff00 broadcast 192.168.128.255
        ether 00:02:b3:1f:25:dc 
        media: Ethernet 100baseTX <full-duplex>
        status: active
fxp1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet 146.254.1.172 netmask 0xffffff00 broadcast 146.254.1.255
        ether 00:a0:c9:a9:1d:06 
        media: Ethernet manual

fxp2: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        ether 00:a0:c9:a9:1d:23 
        media: Ethernet manual

lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
        inet 127.0.0.1 netmask 0xff000000 


With the small patch below it will be like this:

fxp0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet 192.168.128.1 netmask 0xffffff00 broadcast 192.168.128.255
        ether 00:02:b3:1f:25:dc 
        media: Ethernet 100baseTX <full-duplex>
        status: active
fxp1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet 146.254.1.172 netmask 0xffffff00 broadcast 146.254.1.255
        ether 00:a0:c9:a9:1d:06 
        media: Ethernet manual
fxp2: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        ether 00:a0:c9:a9:1d:23 
        media: Ethernet manual
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
        inet 127.0.0.1 netmask 0xff000000 


>How-To-Repeat:

do an ifconfig -a on a machine with inactive interfaces

>Fix:

The patch for -STABLE is:

--- sbin/ifconfig/ifmedia.c.ORI	Sat Sep 15 11:42:10 2001
+++ sbin/ifconfig/ifmedia.c	Sat Sep 15 11:42:27 2001
@@ -168,9 +168,8 @@
 				printf("no carrier");
 			break;
 		}
+		putchar('\n');
 	}
-
-	putchar('\n');
 
 	if (ifmr.ifm_count > 0 && supmedia) {
 		printf("\tsupported media:\n");

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed 
State-Changed-By: yar 
State-Changed-When: Thu Nov 1 18:21:55 PST 2001 
State-Changed-Why:  
Fixed in -current. I'll merge it to -stable in a week. Thanks! 


Responsible-Changed-From-To: freebsd-bugs->yar 
Responsible-Changed-By: yar 
Responsible-Changed-When: Thu Nov 1 18:21:55 PST 2001 
Responsible-Changed-Why:  
I'll fix that. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=30587 
State-Changed-From-To: analyzed->closed 
State-Changed-By: yar 
State-Changed-When: Tue Nov 13 20:35:21 PST 2001 
State-Changed-Why:  
Just merged from -current to -stable as well. Thanks! 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=30587 
>Unformatted:
