* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: /tcpdump/master/tcpdump/interface.h,v 1.144 2000-11-02 02:18:30 fenner Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/interface.h,v 1.145 2000-11-17 19:08:14 itojun Exp $ (LBL)
*/
#ifndef tcpdump_interface_h
const u_char *);
extern void snmp_print(const u_char *, u_int);
extern void sunrpcrequest_print(const u_char *, u_int, const u_char *);
-extern void tcp_print(const u_char *, u_int, const u_char *);
+extern void tcp_print(const u_char *, u_int, const u_char *, int);
extern void tftp_print(const u_char *, u_int);
extern void timed_print(const u_char *, u_int);
-extern void udp_print(const u_char *, u_int, const u_char *);
+extern void udp_print(const u_char *, u_int, const u_char *, int);
extern void wb_print(const void *, u_int);
extern int ah_print(register const u_char *, register const u_char *);
extern int esp_print(register const u_char *, register const u_char *, int *);
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-ip.c,v 1.90 2000-11-02 02:18:30 fenner Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ip.c,v 1.91 2000-11-17 19:08:15 itojun Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
}
case IPPROTO_TCP:
- tcp_print(cp, len, (const u_char *)ip);
+ tcp_print(cp, len, (const u_char *)ip, (off &~ 0x6000));
break;
case IPPROTO_UDP:
- udp_print(cp, len, (const u_char *)ip);
+ udp_print(cp, len, (const u_char *)ip, (off &~ 0x6000));
break;
case IPPROTO_ICMP:
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-ip6.c,v 1.15 2000-11-09 07:43:50 itojun Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ip6.c,v 1.16 2000-11-17 19:08:15 itojun Exp $";
#endif
#ifdef HAVE_CONFIG_H
register int len;
register const u_char *cp;
int nh;
+ int fragmented = 0;
u_int flow;
ip6 = (const struct ip6_hdr *)bp;
if (snapend <= cp + advance)
goto end;
nh = *cp;
+ fragmented = 1;
break;
case IPPROTO_ROUTING:
advance = rt6_print(cp, (const u_char *)ip6);
break;
case IPPROTO_TCP:
tcp_print(cp, len + sizeof(struct ip6_hdr) - (cp - bp),
- (const u_char *)ip6);
+ (const u_char *)ip6, fragmented);
goto end;
case IPPROTO_UDP:
udp_print(cp, len + sizeof(struct ip6_hdr) - (cp - bp),
- (const u_char *)ip6);
+ (const u_char *)ip6, fragmented);
goto end;
case IPPROTO_ICMPV6:
icmp6_print(cp, (const u_char *)ip6);
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-tcp.c,v 1.79 2000-10-07 05:53:14 itojun Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-tcp.c,v 1.80 2000-11-17 19:08:16 itojun Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
void
tcp_print(register const u_char *bp, register u_int length,
- register const u_char *bp2)
+ register const u_char *bp2, int fragmented)
{
register const struct tcphdr *tp;
register const struct ip *ip;
return;
}
- if (IP_V(ip) == 4 && vflag) {
+ if (IP_V(ip) == 4 && vflag && !fragmented) {
int sum;
if (TTEST2(tp->th_sport, length)) {
sum = tcp_cksum(ip, tp, length);
}
}
#ifdef INET6
- if (IP_V(ip) == 6 && ip6->ip6_plen && vflag) {
+ if (IP_V(ip) == 6 && ip6->ip6_plen && vflag && !fragmented) {
int sum;
if (TTEST2(tp->th_sport, length)) {
sum = tcp6_cksum(ip6, tp, length);
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/tcpdump/print-udp.c,v 1.88 2000-10-30 06:22:15 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-udp.c,v 1.89 2000-11-17 19:08:16 itojun Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#endif
void
-udp_print(register const u_char *bp, u_int length, register const u_char *bp2)
+udp_print(register const u_char *bp, u_int length,
+ register const u_char *bp2, int fragmented)
{
register const struct udphdr *up;
register const struct ip *ip;
}
#endif
- if (IP_V(ip) == 4 && vflag) {
+ if (IP_V(ip) == 4 && vflag && !fragmented) {
int sum = up->uh_sum;
if (sum == 0) {
(void)printf(" [no cksum]");
}
}
#ifdef INET6
- if (IP_V(ip) == 6 && ip6->ip6_plen && vflag) {
+ if (IP_V(ip) == 6 && ip6->ip6_plen && vflag && !fragmented) {
int sum = up->uh_sum;
/* for IPv6, UDP checksum is mandatory */
if (TTEST2(cp[0], length)) {