From owner-freebsd-bugs Mon Dec 9 4:30: 4 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AC22137B401 for ; Mon, 9 Dec 2002 04:30:02 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id CB52043EB2 for ; Mon, 9 Dec 2002 04:30:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id gB9CU1x3061955 for ; Mon, 9 Dec 2002 04:30:01 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id gB9CU1Rv061954; Mon, 9 Dec 2002 04:30:01 -0800 (PST) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7059937B401 for ; Mon, 9 Dec 2002 04:26:54 -0800 (PST) Received: from goliath.siemens.de (goliath.siemens.de [192.35.17.28]) by mx1.FreeBSD.org (Postfix) with ESMTP id 967E743EBE for ; Mon, 9 Dec 2002 04:26:52 -0800 (PST) (envelope-from andre.albsmeier@mchp.siemens.de) Received: from mail3.siemens.de (mail3.siemens.de [139.25.208.14]) by goliath.siemens.de (8.11.6/8.11.6) with ESMTP id gB9CQkq08421 for ; Mon, 9 Dec 2002 13:26:46 +0100 (MET) Received: from curry.mchp.siemens.de (curry.mchp.siemens.de [139.25.42.7]) by mail3.siemens.de (8.11.6/8.11.6) with ESMTP id gB9CQjr28751 for ; Mon, 9 Dec 2002 13:26:45 +0100 (MET) Received: (from localhost) by curry.mchp.siemens.de (8.12.6/8.12.6) id gB9CQjUY022599 for FreeBSD-gnats-submit@freebsd.org; Mon, 9 Dec 2002 13:26:45 +0100 (CET) Message-Id: <200212091226.gB9CQjJc046365@curry.mchp.siemens.de> Date: Mon, 9 Dec 2002 13:26:45 +0100 (CET) From: Andre Albsmeier To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/46123: PATCH: tcpdump needs -a flag if netmask is set to 0xffffffff Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >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 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