Date: Mon, 9 Dec 2002 13:26:45 +0100 (CET) From: Andre Albsmeier <andre.albsmeier@mchp.siemens.de> To: FreeBSD-gnats-submit@FreeBSD.org Subject: bin/46123: PATCH: tcpdump needs -a flag if netmask is set to 0xffffffff Message-ID: <200212091226.gB9CQjJc046365@curry.mchp.siemens.de>
next in thread | raw e-mail | index | archive | help
>Number: 46123 >Category: bin >Synopsis: PATCH: tcpdump needs -a flag if netmask is set to 0xffffffff >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Mon Dec 09 04:30:01 PST 2002 >Closed-Date: >Last-Modified: >Originator: Andre Albsmeier >Release: FreeBSD 4.7-STABLE i386 >Organization: >Environment: System: 4.7-STABLE FreeBSD #0: Fri Nov 29 09:27:20 CET 2002 >Description: If the -a flag was not specified tcpdump doesn't convert network and broadcast addresses to names. However, it treats everything as a broadcast address if the interface has a netmask of 0xffffffff (recent versions of ppp set the netmask to 0xffffffff for the tun0 interface). This means that even non-broadcast/network destined traffic won't get their addresses converted. >How-To-Repeat: If you use a recent version of ppp the netmask should be 0xffffffff: andre@gate:~>ifconfig tun0 tun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1492 inet 217.88.xxx.yyy --> 217.5.98.95 netmask 0xffffffff Opened by PID 15634 If you run a tcpdump on tun0 (without -a) you see your traffic but it won't be converted to names. >Fix: The patch disables the check for broadcast/network addresses if the netmask is set to 0xffffffff: --- contrib/tcpdump/addrtoname.c.ORI Thu Sep 12 09:56:44 2002 +++ contrib/tcpdump/addrtoname.c Sat Sep 14 12:35:10 2002 @@ -200,6 +200,7 @@ if (!nflag && (addr & f_netmask) == f_localnet && (aflag || + netmask == 0xffffffff || !((addr & ~netmask) == 0 || (addr | netmask) == 0xffffffff))) { if (!setjmp(getname_env)) { (void)setsignal(SIGALRM, nohostname); >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200212091226.gB9CQjJc046365>