"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "print-icmp.c" between
tcpdump-4.99.0.tar.gz and tcpdump-4.99.1.tar.gz

About: tcpdump is a tool for network monitoring and data acquisition.

print-icmp.c  (tcpdump-4.99.0):print-icmp.c  (tcpdump-4.99.1)
skipping to change at line 229 skipping to change at line 229
nd_uint32_t ird_addr; nd_uint32_t ird_addr;
nd_uint32_t ird_pref; nd_uint32_t ird_pref;
}; };
/* /*
* draft-bonica-internet-icmp-08 * draft-bonica-internet-icmp-08
* *
* The Destination Unreachable, Time Exceeded * The Destination Unreachable, Time Exceeded
* and Parameter Problem messages are slightly changed as per * and Parameter Problem messages are slightly changed as per
* the above draft. A new Length field gets added to give * the above draft. A new Length field gets added to give
* the caller an idea about the length of the piggypacked * the caller an idea about the length of the piggybacked
* IP packet before the MPLS extension header starts. * IP packet before the MPLS extension header starts.
* *
* The Length field represents length of the padded "original datagram" * The Length field represents length of the padded "original datagram"
* field measured in 32-bit words. * field measured in 32-bit words.
* *
* 0 1 2 3 * 0 1 2 3
* 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Type | Code | Checksum | * | Type | Code | Checksum |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
skipping to change at line 308 skipping to change at line 308
const struct icmp *dp; const struct icmp *dp;
uint8_t icmp_type, icmp_code; uint8_t icmp_type, icmp_code;
const struct icmp_ext_t *ext_dp; const struct icmp_ext_t *ext_dp;
const struct ip *ip; const struct ip *ip;
const char *str; const char *str;
const struct ip *oip; const struct ip *oip;
uint8_t ip_proto; uint8_t ip_proto;
const struct udphdr *ouh; const struct udphdr *ouh;
const uint8_t *obj_tptr; const uint8_t *obj_tptr;
uint32_t raw_label; uint32_t raw_label;
const u_char *snapend_save;
const struct icmp_mpls_ext_object_header_t *icmp_mpls_ext_object_header; const struct icmp_mpls_ext_object_header_t *icmp_mpls_ext_object_header;
u_int hlen, mtu, obj_tlen, obj_class_num, obj_ctype; u_int hlen, mtu, obj_tlen, obj_class_num, obj_ctype;
uint16_t dport; uint16_t dport;
char buf[MAXHOSTNAMELEN + 100]; char buf[MAXHOSTNAMELEN + 100];
struct cksum_vec vec[1]; struct cksum_vec vec[1];
ndo->ndo_protocol = "icmp"; ndo->ndo_protocol = "icmp";
dp = (const struct icmp *)bp; dp = (const struct icmp *)bp;
ext_dp = (const struct icmp_ext_t *)bp; ext_dp = (const struct icmp_ext_t *)bp;
ip = (const struct ip *)bp2; ip = (const struct ip *)bp2;
skipping to change at line 654 skipping to change at line 653
in_cksum_shouldbe(icmp_sum, sum)); in_cksum_shouldbe(icmp_sum, sum));
} }
} }
} }
/* /*
* print the remnants of the IP packet. * print the remnants of the IP packet.
* save the snaplength as this may get overridden in the IP printer. * save the snaplength as this may get overridden in the IP printer.
*/ */
if (ndo->ndo_vflag >= 1 && ICMP_ERRTYPE(icmp_type)) { if (ndo->ndo_vflag >= 1 && ICMP_ERRTYPE(icmp_type)) {
const u_char *snapend_save;
bp += 8; bp += 8;
ND_PRINT("\n\t"); ND_PRINT("\n\t");
ip = (const struct ip *)bp; ip = (const struct ip *)bp;
snapend_save = ndo->ndo_snapend; snapend_save = ndo->ndo_snapend;
/*
* Update the snapend because extensions (MPLS, ...) may be
* present after the IP packet. In this case the current
* (outer) packet's snapend is not what ip_print() needs to
* decode an IP packet nested in the middle of an ICMP payload.
*
* This prevents that, in ip_print(), for the nested IP packet,
* the remaining length < remaining caplen.
*/
ndo->ndo_snapend = ND_MIN(bp + GET_BE_U_2(ip->ip_len),
ndo->ndo_snapend);
ip_print(ndo, bp, GET_BE_U_2(ip->ip_len)); ip_print(ndo, bp, GET_BE_U_2(ip->ip_len));
ndo->ndo_snapend = snapend_save; ndo->ndo_snapend = snapend_save;
} }
/* ndo_protocol reassignment after ip_print() call */ /* ndo_protocol reassignment after ip_print() call */
ndo->ndo_protocol = "icmp"; ndo->ndo_protocol = "icmp";
/* /*
* Attempt to decode the MPLS extensions only for some ICMP types. * Attempt to decode the MPLS extensions only for some ICMP types.
*/ */
if (ndo->ndo_vflag >= 1 && plen > ICMP_EXTD_MINLEN && ICMP_MPLS_EXT_TYPE (icmp_type)) { if (ndo->ndo_vflag >= 1 && plen > ICMP_EXTD_MINLEN && ICMP_MPLS_EXT_TYPE (icmp_type)) {
 End of changes. 5 change blocks. 
4 lines changed or deleted 16 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)