]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ip.c
use the offical LMP port number as per rfc4204
[tcpdump] / print-ip.c
index aa20ce5f5290584d2a19eb7b5f308567f1072e46..bdf8ccf94e52e45713480880a7da25cabcddb384 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.5 2005-11-13 20:30:18 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -341,12 +341,6 @@ in_cksum_shouldbe(u_int16_t sum, u_int16_t computed_sum)
        return shouldbe;
 }
 
-#ifndef IP_MF
-#define IP_MF 0x2000
-#endif /* IP_MF */
-#ifndef IP_DF
-#define IP_DF 0x4000
-#endif /* IP_DF */
 #define IP_RES 0x8000
 
 static struct tok ip_frag_values[] = {
@@ -417,19 +411,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: