]> The Tcpdump Group git mirrors - tcpdump/commitdiff
From pfhunt on SourceForge:
authorguy <guy>
Fri, 14 Sep 2007 00:38:41 +0000 (00:38 +0000)
committerguy <guy>
Fri, 14 Sep 2007 00:38:41 +0000 (00:38 +0000)
When a packet contains an IPv6 options header followed by an unknown IPv6
protocol payload, tcpdump displays the proto ID for the known option
header, not for the unknown payload.

For example, this is the output for an IPv6 packet containing a destination
options header, followed by a payload of (unknown) protocol 138:

# tcpdump -s 128 -i eth1
tcpdump: WARNING: addresses not searched
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth1, link-type EN10MB (Ethernet), capture size 128 bytes
11:44:40.862572 I IP6 2007::10:5:2:163 > 2007::10:5:2:164: DSTOPT ip-proto-60 16

The ip-proto-60 refers to the destination option header (DSTOPT), rather
than displaying the unknown option 138, which I think would be more
informative.

The attached patch fixes this problem. With the patch applied, the output
for the packet is:

# tcpdump -s 128 -i eth1
tcpdump: WARNING: addresses not searched
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth1, link-type EN10MB (Ethernet), capture size 128 bytes
11:48:26.160462 I IP6 2007::10:5:2:163 > 2007::10:5:2:164: DSTOPT ip-proto-138 16

CREDITS
print-ip6.c

diff --git a/CREDITS b/CREDITS
index 12878c5e3e3b7f58a3f533d86f91d3c2557ff938..f80ed4b5fdfb02d27e07c28faf216ca08a7d125a 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -121,6 +121,7 @@ Additional people who have contributed patches:
        Pekka Savola                    <[email protected]>     
        Peter Fales                     <[email protected]>
        Peter Jeremy                    <[email protected]>
+                                       <[email protected]>
        Phil Wood                       <[email protected]>
        Rafal Maszkowski                <[email protected]>
        Raphael Raimbault               <[email protected]>
index f43d61aab2e82e203abd5c09ff646c514fa723e1..e04da5252424e0e79df5d3e2ce9d94bfe31c0dc5 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-ip6.c,v 1.50 2005-09-20 06:01:23 guy Exp $";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-ip6.c,v 1.51 2007-09-14 00:38:41 guy Exp $";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -225,7 +225,7 @@ ip6_print(register const u_char *bp, register u_int length)
                        return;
 
                default:
-                       (void)printf("ip-proto-%d %d", ip6->ip6_nxt, len);
+                       (void)printf("ip-proto-%d %d", nh, len);
                        return;
                }
        }