]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Properly pass the MF flag and fragment offset to the UDP, TCP, and ICMP
authorguy <guy>
Sun, 13 Nov 2005 11:51:52 +0000 (11:51 +0000)
committerguy <guy>
Sun, 13 Nov 2005 11:51:52 +0000 (11:51 +0000)
print routines.

print-ip.c

index aa20ce5f5290584d2a19eb7b5f308567f1072e46..6c823ec4741646b0a928e8742217250455eecd9a 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-ip.c,v 1.149.2.3 2005-10-07 10:49:28 hannes Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-ip.c,v 1.149.2.4 2005-11-13 11:51:52 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -417,19 +417,21 @@ again:
                break;
                
        case IPPROTO_TCP:
+               /* pass on the MF bit plus the offset to detect fragments */
                tcp_print(ipds->cp, ipds->len, (const u_char *)ipds->ip,
-                         (ipds->off &~ 0x6000));
+                         ipds->off & (IP_MF|IP_OFFMASK));
                break;
                
        case IPPROTO_UDP:
+               /* pass on the MF bit plus the offset to detect fragments */
                udp_print(ipds->cp, ipds->len, (const u_char *)ipds->ip,
-                         (ipds->off &~ 0x6000));
+                         ipds->off & (IP_MF|IP_OFFMASK));
                break;
                
        case IPPROTO_ICMP:
                /* pass on the MF bit plus the offset to detect fragments */
                icmp_print(ipds->cp, ipds->len, (const u_char *)ipds->ip,
-                          (ipds->off &~ 0x6000));
+                          ipds->off & (IP_MF|IP_OFFMASK));
                break;
                
        case IPPROTO_PIGP: