From nobody@FreeBSD.org  Mon Mar  4 15:45:46 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	by hub.freebsd.org (Postfix) with ESMTP id 33D786EC
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  4 Mar 2013 15:45:46 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 223FD231
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  4 Mar 2013 15:45:46 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id r24Fjjxi076071
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 4 Mar 2013 15:45:45 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id r24FjjcE076070;
	Mon, 4 Mar 2013 15:45:45 GMT
	(envelope-from nobody)
Message-Id: <201303041545.r24FjjcE076070@red.freebsd.org>
Date: Mon, 4 Mar 2013 15:45:45 GMT
From: Frank Chen <frank.chen2@baesystems.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: netstat will display pcb table twice for any ip interfaces.
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         176639
>Category:       bin
>Synopsis:       [patch] netstat(1) will display pcb table twice for any ip interfaces.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 04 15:50:00 UTC 2013
>Closed-Date:    
>Last-Modified:  Tue Mar 05 16:30:47 UTC 2013
>Originator:     Frank Chen
>Release:        9.0
>Organization:
BAE systems inc.
>Environment:
>Description:
run netstat -a -A for a system with ip(ip6) interface, the interface will show as:

Tcpcb     Proto   Recv-Q Send-Q Local Address Foreign Address (state)
c6770ec4   ip 4        0      0 *.*           *.*
c6770ec4   ip64        0      0 *.*           *.*
(for ip6 interfaces)
xxxxxxxx   ip 6        0      0 *.*           *.*
xxxxxxxx   ip66        0      0 *.*           *.*
>How-To-Repeat:

>Fix:
--- inet.c	2012-09-19 16:43:07.390456077 -0400
+++ /tmp/inet.c	2013-03-04 10:38:19.345392528 -0500
@@ -85,7 +85,7 @@
 char	*inetname(struct in_addr *);
 void	inetprint(struct in_addr *, int, const char *, int);
 #ifdef INET6
-static int udp_done, tcp_done, sdp_done;
+static int udp_done, tcp_done, sdp_done, raw_done;
 #endif /* INET6 */
 
 static int
@@ -338,6 +338,14 @@
 			udp_done = 1;
 #endif
 		break;
+	case IPPROTO_RAW:
+#ifdef INET6
+		if (raw_done != 0)
+			return;
+		else
+			raw_done = 1;
+#endif
+		break;
 	}
 	if (live) {
 		if (!pcblist_sysctl(proto, name, &buf, istcp))


>Release-Note:
>Audit-Trail:
>Unformatted:
