Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Jan 2008 20:38:24 GMT
From:      Niki Denev <niki@totalterror.net>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   bin/119542: netstat does not print correcty L2 routes on bridge interfaces
Message-ID:  <200801102038.m0AKcOKN089613@www.freebsd.org>
Resent-Message-ID: <200801102040.m0AKe2Ii066365@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         119542
>Category:       bin
>Synopsis:       netstat does not print correcty L2 routes on bridge interfaces
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan 10 20:40:01 UTC 2008
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200801102038.m0AKcOKN089613>