Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Oct 2000 23:43:33 -0500 (CDT)
From:      Matthew Cerha <mcerha@mcerha-dsl2.cisco.com>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/22138: tcpdump not handling 
Message-ID:  <200010200443.e9K4hXk58824@mcerha-dsl2.cisco.com>

next in thread | raw e-mail | index | archive | help

>Number:         22138
>Category:       bin
>Synopsis:       tcpdump not handling -v option correctly
>Confidential:   yes
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Oct 19 21:50:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Matthew Cerha
>Release:        FreeBSD 4.1-STABLE i386
>Organization:
CharlieFox Consulting
>Environment:

FreeBSD mcerha-dsl2.cisco.com 4.1-STABLE FreeBSD 4.1-STABLE #0: Thu Sep 21 22:24:06 CDT 2000     mcerha@super.freak.net:/usr/obj/cvs/FreeBSD/4.x/src/sys/SMP  i386

>Description:

It appears that tcpdump does not properly interpret the -v (verbose) option
for TCP packet decodes. There appears to be a flaw in the flow control. 

In src/contrib/tcpdump/print-tcp.c:

497         if (!qflag && vflag && length > 0
498          && (sport == TELNET_PORT || dport == TELNET_PORT))
499                 telnet_print(bp, length);
500         else if (sport == BGP_PORT || dport == BGP_PORT)
501                 bgp_print(bp, length);
502         else if (sport == NETBIOS_SSN_PORT || dport == NETBIOS_SSN_PORT)    503                 nbt_tcp_print(bp, length);
504         return;

The first section doesn't make sense. The sport and dport clauses should be
grouped together and not with the flag clause.

PS Jerry found this bug. I'm just trying to report it :)

>How-To-Repeat:

Just run tcpdump -v.

>Fix:

Apply the diff to src/contrib/tcpdump/print-tcp.c.

497,498c497,498
A
< 	if (!qflag && vflag && length > 0) {
< 	 if (sport == TELNET_PORT || dport == TELNET_PORT)
---
> 	if (!qflag && vflag && length > 0
> 	 && (sport == TELNET_PORT || dport == TELNET_PORT))
504d503
< 	}



>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?200010200443.e9K4hXk58824>