From nobody@FreeBSD.org  Mon Mar 22 09:24:35 2004
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 8A48716A4CE
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 22 Mar 2004 09:24:35 -0800 (PST)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 6CC0543D45
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 22 Mar 2004 09:24:35 -0800 (PST)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.10/8.12.10) with ESMTP id i2MHOZ72097698
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 22 Mar 2004 09:24:35 -0800 (PST)
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.10/8.12.10/Submit) id i2MHOZhf097697;
	Mon, 22 Mar 2004 09:24:35 -0800 (PST)
	(envelope-from nobody)
Message-Id: <200403221724.i2MHOZhf097697@www.freebsd.org>
Date: Mon, 22 Mar 2004 09:24:35 -0800 (PST)
From: Brian Minder <bmm@minder.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: ipfilter/ipmon confused by interface numbers > 255
X-Send-Pr-Version: www-2.3

>Number:         64584
>Category:       misc
>Synopsis:       ipfilter/ipmon confused by interface numbers > 255
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    darrenr
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 22 09:30:14 PST 2004
>Closed-Date:    Mon Jul 05 16:55:35 GMT 2004
>Last-Modified:  Mon Jul 05 16:55:35 GMT 2004
>Originator:     Brian Minder
>Release:        4.9-RELEASE-p4
>Organization:
n/a
>Environment:
FreeBSD brazil 4.9-RELEASE-p4 FreeBSD 4.9-RELEASE-p4 #1: Wed Mar 17 12:44:27 EST 2004 root@brazil:/usr/obj/usr/src/sys/BRAZIL49  i386

>Description:
The interface number indicated by ipmon/syslog rolls over when greater than 255.  For example, a packet on the interface "vlan300" is logged as "vlan44" by ipmon:

ipmon[58]: 11:37:44.649718 vlan44 @0:123 b 192.168.186.205,3122 -> 10.20.30.178,43741 PR udp len 20 894 IN


>How-To-Repeat:
# diff BRAZIL49 GENERIC
63,67d62
< options         IPFILTER
< options         IPFILTER_LOG
< options         IPFILTER_DEFAULT_BLOCK
< options         IPSTEALTH
255c249
< pseudo-device bpf     8       #Berkeley packet filter
---
> pseudo-device bpf             #Berkeley packet filter

# ifconfig
fxp0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet 10.20.30.1 netmask 0xffffff80 broadcast 10.20.30.127
        inet6 fe80::2b0:d0ff:fe3d:5458%fxp0 prefixlen 64 scopeid 0x1
        ether 00:b0:d0:3d:54:58
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
lp0: flags=8810<POINTOPOINT,SIMPLEX,MULTICAST> mtu 1500
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x7
        inet 127.0.0.1 netmask 0xff000000
ppp0: flags=8010<POINTOPOINT,MULTICAST> mtu 1500
sl0: flags=c010<POINTOPOINT,LINK2,MULTICAST> mtu 552
faith0: flags=8002<BROADCAST,MULTICAST> mtu 1500
vlan100: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet 10.20.30.129 netmask 0xffffffe0 broadcast 10.20.30.159
        inet6 fe80::2b0:d0ff:fe3d:5458%vlan100 prefixlen 64 scopeid 0xb
        ether 00:b0:d0:3d:54:58
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
        vlan: 100 parent interface: fxp0
vlan200: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet 10.20.30.161 netmask 0xfffffff0 broadcast 10.20.30.175
        inet6 fe80::2b0:d0ff:fe3d:5458%vlan200 prefixlen 64 scopeid 0xc
        ether 00:b0:d0:3d:54:58
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
        vlan: 200 parent interface: fxp0
vlan300: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet 10.20.30.178 netmask 0xfffffff0 broadcast 10.20.30.191
        inet6 fe80::2b0:d0ff:fe3d:5458%vlan300 prefixlen 64 scopeid 0xd
        ether 00:b0:d0:3d:54:58
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
        vlan: 300 parent interface: fxp0

>Fix:
Workaround is to rename interfaces to numbers < 255, if possible.  It would be nice if VLAN interfaces could be named to match the corresponding 802.1Q VLAN ID, which can be up to 4095.
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->darrenr 
Responsible-Changed-By: bms 
Responsible-Changed-When: Fri Jun 18 03:42:43 GMT 2004 
Responsible-Changed-Why:  
Darren is Mr ipfilter 

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

From: darrenr@FreeBSD.ORG (Darren Reed)
To: bmm@minder.net
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: misc/64584
Date: Sun, 20 Jun 2004 01:49:48 +0000 (GMT)

 Try this patch on src/contrib/ipfilter/ip_log.c.
 
 Darren
 
 Index: ip_log.c
 ===================================================================
 RCS file: /devel/CVS/IP-Filter/ip_log.c,v
 retrieving revision 2.5.2.25
 diff -c -r2.5.2.25 ip_log.c
 *** ip_log.c	2004/04/10 11:46:51	2.5.2.25
 --- ip_log.c	2004/06/20 01:46:28
 ***************
 *** 251,257 ****
         (defined(__FreeBSD__) && (__FreeBSD_version >= 501113))
   	strncpy(ipfl.fl_ifname, ifp->if_xname, IFNAMSIZ);
   #  else
 ! 	ipfl.fl_unit = (u_char)ifp->if_unit;
   	strncpy(ipfl.fl_ifname, ifp->if_name, MIN(sizeof(ipfl.fl_ifname),
   						  sizeof(ifp->if_name)));
   #  endif
 --- 251,257 ----
         (defined(__FreeBSD__) && (__FreeBSD_version >= 501113))
   	strncpy(ipfl.fl_ifname, ifp->if_xname, IFNAMSIZ);
   #  else
 ! 	ipfl.fl_unit = (u_int)ifp->if_unit;
   	strncpy(ipfl.fl_ifname, ifp->if_name, MIN(sizeof(ipfl.fl_ifname),
   						  sizeof(ifp->if_name)));
   #  endif
State-Changed-From-To: open->closed 
State-Changed-By: darrenr 
State-Changed-When: Mon Jul 5 16:53:15 GMT 2004 
State-Changed-Why:  
bug fixed 

http://www.freebsd.org/cgi/query-pr.cgi?pr=64584 
>Unformatted:
