Subject: bin/25122: ipfstat state top broken with IPv6 addresses
To: None <gnats-bugs@gnats.NetBSD.org>
From: Peter Postma <peter@pointless.nl>
List: netbsd-bugs
Date: 04/10/2004 14:37:48
>Number:         25122
>Category:       bin
>Synopsis:       ipfstat state top broken with IPv6 addresses
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Apr 10 12:38:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Peter Postma
>Release:        NetBSD 2.0C
>Organization:
>Environment:
System: NetBSD mercury.pointless.nl 2.0C NetBSD 2.0C (mercury) #39: Sat Apr 10 01:40:55 CEST 2004 peter@mercury.pointless.nl:/usr/obj/sys/arch/sparc64/compile/mercury sparc64
Architecture: sparc64
Machine: sparc64
>Description:
	The state top program shows the state table.  It hasn't got support
	for IPv6 but it tries to show IPv6 addresses anyway.
	This results in displaying bogus addresses.
>How-To-Repeat:
	Use IPv6 keep state rules, make a connection that adds a new state.
	Start ipfstat -t.  Note the bogus addresses.
>Fix:
	1) Ignore IPv6 addresses in state top (see the diff below).

	2) Add proper IPv6 support to state top (I've a patch for this
	   but I haven't asked Darren to review it, will do later).


Index: ipfstat.c
===================================================================
RCS file: /cvsroot/src/dist/ipf/tools/ipfstat.c,v
retrieving revision 1.3
diff -u -r1.3 ipfstat.c
--- ipfstat.c	7 Apr 2004 20:27:54 -0000	1.3
+++ ipfstat.c	10 Apr 2004 12:17:10 -0000
@@ -1022,6 +1022,9 @@
 				break;
 			ipsstp->iss_list = ips.is_next;
 
+			if (ips.is_v != 4)
+				continue;
+
 			if (((saddr.s_addr == INADDR_ANY) ||
 			     (saddr.s_addr == ips.is_saddr)) &&
 			    ((daddr.s_addr == INADDR_ANY) ||

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