From nobody@FreeBSD.org  Thu Jan 10 20:39:31 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D8BD616A469
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 10 Jan 2008 20:39:31 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id A2B2213C4F9
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 10 Jan 2008 20:39:31 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m0AKcOSf089614
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 10 Jan 2008 20:38:24 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m0AKcOKN089613;
	Thu, 10 Jan 2008 20:38:24 GMT
	(envelope-from nobody)
Message-Id: <200801102038.m0AKcOKN089613@www.freebsd.org>
Date: Thu, 10 Jan 2008 20:38:24 GMT
From: Niki Denev <niki@totalterror.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: netstat does not print correcty L2 routes on bridge interfaces
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         119542
>Category:       bin
>Synopsis:       netstat(1) does not print correcty L2 routes on bridge interfaces
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    thompsa
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan 10 20:40:01 UTC 2008
>Closed-Date:    Sun Aug 10 06:04:15 UTC 2008
>Last-Modified:  Sun Aug 10 06:10:02 UTC 2008
>Originator:     Niki Denev
>Release:        FreeBSD 7.0-BETA2
>Organization:
>Environment:
FreeBSD ndenev.office.suresupport.com 7.0-BETA2 FreeBSD 7.0-BETA2 #5: Sat Nov  3 18:13:12 EET 2007     ndenev@ndenev.office:/usr/obj/usr/src/sys/XXX  i386
>Description:
When viewing the routing table with netstat, all L2 host routes accessible on a bridge interface are shown incorrectly formatted. The delimiter is '.' and not ':', and the octets are not zero prepended if they are only one char.
>How-To-Repeat:
ndenev# netstat -rnfinet
Routing tables

Internet:
Destination        Gateway            Flags    Refs      Use  Netif Expire
default            192.168.0.1       UGS         0     3301 bridge
127.0.0.1          127.0.0.1          UH          0        0    lo0
192.168.0.0/24    link#3             UC          0        0 bridge
192.168.0.1       0.e.c.aa.da.c2     UHLW        2        0 bridge    997
192.168.0.15      0.c.6e.e4.1d.fb    UHLW        1       72 bridge    383
192.168.0.22      0.30.48.75.2f.ac   UHLW        1     1377 bridge   1069

>Fix:
Patch your netstat with the attached patch or from : http://bg.freebsd.org/~ndenev/src/netstat-bridge_l2_route_fix.patch

And then the output should be OK :

ndenev# netstat -rnfinet
Routing tables

Internet:
Destination        Gateway            Flags    Refs      Use  Netif Expire
default            192.168.0.1       UGS         0     4966 bridge
127.0.0.1          127.0.0.1          UH          0        0    lo0
192.168.0.0/24    link#3             UC          0        0 bridge
192.168.0.1       00:0e:0c:aa:da:c2  UHLW        2        0 bridge    659
192.168.0.15      00:0c:6e:e4:1d:fb  UHLW        1      100 bridge   1085
192.168.0.22      00:30:48:75:2f:ac  UHLW        1     2060 bridge    731

Patch attached with submission follows:

--- usr.bin/netstat/route.c.orig	2008-01-11 04:14:54.000000000 +0000
+++ usr.bin/netstat/route.c	2008-01-11 04:15:55.000000000 +0000
@@ -660,6 +660,7 @@
 
 			case IFT_ETHER:
 			case IFT_L2VLAN:
+			case IFT_BRIDGE:
 				if (sdl->sdl_alen == ETHER_ADDR_LEN) {
 					cp = ether_ntoa((struct ether_addr *)
 					    (sdl->sdl_data + sdl->sdl_nlen));


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->patched 
State-Changed-By: thompsa 
State-Changed-When: Thu Jan 10 20:53:28 UTC 2008 
State-Changed-Why:  
Committed, thanks for the patch. 


Responsible-Changed-From-To: freebsd-bugs->thompsa 
Responsible-Changed-By: thompsa 
Responsible-Changed-When: Thu Jan 10 20:53:28 UTC 2008 
Responsible-Changed-Why:  
Committed, thanks for the patch. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=119542 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/119542: commit references a PR
Date: Thu, 10 Jan 2008 20:53:23 +0000 (UTC)

 thompsa     2008-01-10 20:53:13 UTC
 
   FreeBSD src repository
 
   Modified files:
     usr.bin/netstat      route.c 
   Log:
   Add IFT_BRIDGE to the Ethernet section so l2 addresses are formatted correctly.
   
   PR:             bin/119542
   Submitted by:   Niki Denev
   
   Revision  Changes    Path
   1.85      +1 -0      src/usr.bin/netstat/route.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: thompsa 
State-Changed-When: Sun Aug 10 06:03:56 UTC 2008 
State-Changed-Why:  
MFC complete, thanks for the PR. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=119542 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/119542: commit references a PR
Date: Sun, 10 Aug 2008 06:03:57 +0000 (UTC)

 thompsa     2008-08-10 06:03:46 UTC
 
   FreeBSD src repository
 
   Modified files:        (Branch: RELENG_6)
     usr.bin/netstat      route.c 
   Log:
   SVN rev 181497 on 2008-08-10 06:03:46Z by thompsa
   
   MFC r175217
   
    Add IFT_BRIDGE to the Ethernet section so l2 addresses are formatted correctly.
   
    PR:            bin/119542
   
   Revision  Changes    Path
   1.76.2.7  +1 -0      src/usr.bin/netstat/route.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
