NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/44721: getprotobynumber() fails in tcpdump



>Number:         44721
>Category:       bin
>Synopsis:       getprotobynumber() fails in tcpdump
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Mar 14 09:20:05 +0000 2011
>Originator:     Antti Kantee
>Release:        
>Organization:
>Environment:
>Description:
tcpdump on -current prints "ip-proto-1" for an icmp fragment.
This is the relevant code snippet (print-ip.c):

                if ((proto = getprotobynumber(ipds->ip->ip_p)) != NULL)
                    (void)printf(" %s", proto->p_name);
                else
                    (void)printf(" ip-proto-%d", ipds->ip->ip_p);

Putting a print into the routine confirms that getprotobynumber()
returns NULL.  Also, on nb5 tcpdump correctly prints "icmp" here.

Finally, a standalone program calling only getprotobynumber(1)
produces the expected result.
>How-To-Repeat:
run tests/usr.bin/shmif_dumpbus/t_basic::pcap

(a more standalone test is recommended once the problem has been
pinpointed and fixed)
>Fix:



Home | Main Index | Thread Index | Old Index