Deleted Added
full compact
21c21
< * $FreeBSD: head/contrib/tcpdump/print-ip.c 162021 2006-09-04 20:25:04Z sam $
---
> * $FreeBSD: head/contrib/tcpdump/print-ip.c 172686 2007-10-16 02:31:48Z mlaier $
26c26
< "@(#) $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.9 2007/09/14 01:30:02 guy Exp $ (LBL)";
54a55
> { IPOPT_RFC1393, "traceroute" },
78c79
< printf("%s", ipaddr_string(&cp[len]));
---
> printf(" %s", ipaddr_string(&cp[len]));
80c81
< printf (", ");
---
> printf(",");
142c143
< printf("[bad length %d]", length);
---
> printf("[bad length %u]", length);
148c149
< printf("[bad length %d]", length);
---
> printf("[bad length %u]", length);
152c153
< printf("[bad ptr %d]", cp[2]);
---
> printf("[bad ptr %u]", cp[2]);
201a203
> const char *sep = "";
205a208,210
> printf("%s", sep);
> sep = ",";
>
208a214,216
> printf("%s",
> tok2str(ip_option_values,"unknown %u",option_code));
>
215c223,227
< option_len = cp[1];
---
> option_len = cp[1];
> if (option_len < 2) {
> printf(" [bad length %u]", option_len);
> return;
> }
218,221c230,233
< printf("%s (%u) len %u",
< tok2str(ip_option_values,"unknown",option_code),
< option_code,
< option_len);
---
> if (option_len > length) {
> printf(" [bad length %u]", option_len);
> return;
> }
223,225d234
< if (option_len < 2)
< return;
<
239c248
< ip_printroute( cp, option_len);
---
> ip_printroute(cp, option_len);
242a252,255
> if (option_len < 4) {
> printf(" [bad length %u]", option_len);
> break;
> }
245c258
< printf("value %u", EXTRACT_16BITS(&cp[2]));
---
> printf(" value %u", EXTRACT_16BITS(&cp[2]));
346,351d358
< #ifndef IP_MF
< #define IP_MF 0x2000
< #endif /* IP_MF */
< #ifndef IP_DF
< #define IP_DF 0x4000
< #endif /* IP_DF */
421a429
> /* pass on the MF bit plus the offset to detect fragments */
423c431
< (ipds->off &~ 0x6000));
---
> ipds->off & (IP_MF|IP_OFFMASK));
426a435
> /* pass on the MF bit plus the offset to detect fragments */
428c437
< (ipds->off &~ 0x6000));
---
> ipds->off & (IP_MF|IP_OFFMASK));
434c443
< (ipds->off & 0x3fff));
---
> ipds->off & (IP_MF|IP_OFFMASK));
630c639
< (void)printf(", ttl %3u", ipds->ip->ip_ttl);
---
> (void)printf(", ttl %u", ipds->ip->ip_ttl);
638c647
< (void)printf(", id %u, offset %u, flags [%s], proto: %s (%u)",
---
> (void)printf(", id %u, offset %u, flags [%s], proto %s (%u)",
641c650
< bittok2str(ip_frag_values, "none", ipds->off&0xe000 ),
---
> bittok2str(ip_frag_values, "none", ipds->off&0xe000),
645c654
< (void)printf(", length: %u", EXTRACT_16BITS(&ipds->ip->ip_len));
---
> (void)printf(", length %u", EXTRACT_16BITS(&ipds->ip->ip_len));
648c657
< printf(", options ( ");
---
> printf(", options (");
650c659
< printf(" )");
---
> printf(")");