X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/013fa4668bd22cb34ae5942303ad09ce12820932..2043adc02537f5e50ce1b4001ef3d5e8ba9990a8:/print-ip.c?ds=inline diff --git a/print-ip.c b/print-ip.c index 4bb68c07..bdf8ccf9 100644 --- a/print-ip.c +++ b/print-ip.c @@ -21,7 +21,7 @@ #ifndef lint static const char rcsid[] _U_ = - "@(#) $Header: /tcpdump/master/tcpdump/print-ip.c,v 1.149.2.2 2005-09-20 06:05:38 guy 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 & 0x3fff)); + ipds->off & (IP_MF|IP_OFFMASK)); break; case IPPROTO_PIGP: