"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "print-tcp.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-tcp.c  (tcpdump-4.99.0):print-tcp.c  (tcpdump-4.99.1)
skipping to change at line 174 skipping to change at line 174
const struct ip *ip; const struct ip *ip;
u_char flags; u_char flags;
u_int hlen; u_int hlen;
char ch; char ch;
uint16_t sport, dport, win, urp; uint16_t sport, dport, win, urp;
uint32_t seq, ack, thseq, thack; uint32_t seq, ack, thseq, thack;
u_int utoval; u_int utoval;
uint16_t magic; uint16_t magic;
int rev; int rev;
const struct ip6_hdr *ip6; const struct ip6_hdr *ip6;
u_int header_len; /* Header length in bytes */
ndo->ndo_protocol = "tcp"; ndo->ndo_protocol = "tcp";
tp = (const struct tcphdr *)bp; tp = (const struct tcphdr *)bp;
ip = (const struct ip *)bp2; ip = (const struct ip *)bp2;
if (IP_V(ip) == 6) if (IP_V(ip) == 6)
ip6 = (const struct ip6_hdr *)bp2; ip6 = (const struct ip6_hdr *)bp2;
else else
ip6 = NULL; ip6 = NULL;
ch = '\0'; ch = '\0';
if (!ND_TTEST_2(tp->th_dport)) { if (!ND_TTEST_2(tp->th_dport)) {
skipping to change at line 613 skipping to change at line 614
utoval = GET_BE_U_2(cp); utoval = GET_BE_U_2(cp);
ND_PRINT(" 0x%x", utoval); ND_PRINT(" 0x%x", utoval);
if (utoval & 0x0001) if (utoval & 0x0001)
utoval = (utoval >> 1) * 60; utoval = (utoval >> 1) * 60;
else else
utoval >>= 1; utoval >>= 1;
ND_PRINT(" %u", utoval); ND_PRINT(" %u", utoval);
break; break;
case TCPOPT_MPTCP: case TCPOPT_MPTCP:
{
const u_char *snapend_save;
int ret;
datalen = len - 2; datalen = len - 2;
LENCHECK(datalen); LENCHECK(datalen);
if (!mptcp_print(ndo, cp-2, len, flags)) /* Update the snapend to the end of the option
* before calling mptcp_print(). Some options
* (MPTCP or others) may be present after a
* MPTCP option. This prevents that, in
* mptcp_print(), the remaining length < the
* remaining caplen.
*/
snapend_save = ndo->ndo_snapend;
ndo->ndo_snapend = ND_MIN(cp - 2 + len,
ndo->ndo_snapend);
ret = mptcp_print(ndo, cp - 2, len, flags);
ndo->ndo_snapend = snapend_save;
if (!ret)
goto bad; goto bad;
break; break;
}
case TCPOPT_FASTOPEN: case TCPOPT_FASTOPEN:
datalen = len - 2; datalen = len - 2;
LENCHECK(datalen); LENCHECK(datalen);
ND_PRINT(" "); ND_PRINT(" ");
print_tcp_fastopen_option(ndo, cp, datalen, FALS E); print_tcp_fastopen_option(ndo, cp, datalen, FALS E);
break; break;
case TCPOPT_EXPERIMENT2: case TCPOPT_EXPERIMENT2:
datalen = len - 2; datalen = len - 2;
skipping to change at line 687 skipping to change at line 705
* Print length field before crawling down the stack. * Print length field before crawling down the stack.
*/ */
ND_PRINT(", length %u", length); ND_PRINT(", length %u", length);
if (length <= 0) if (length <= 0)
return; return;
/* /*
* Decode payload if necessary. * Decode payload if necessary.
*/ */
bp += TH_OFF(tp) * 4; header_len = TH_OFF(tp) * 4;
/*
* Do a bounds check before decoding the payload.
* At least the header data is required.
*/
if (!ND_TTEST_LEN(bp, header_len)) {
ND_PRINT(" [remaining caplen(%u) < header length(%u)]",
ND_BYTES_AVAILABLE_AFTER(bp), header_len);
nd_trunc_longjmp(ndo);
}
bp += header_len;
if ((flags & TH_RST) && ndo->ndo_vflag) { if ((flags & TH_RST) && ndo->ndo_vflag) {
print_tcp_rst_data(ndo, bp, length); print_tcp_rst_data(ndo, bp, length);
return; return;
} }
if (ndo->ndo_packettype) { if (ndo->ndo_packettype) {
switch (ndo->ndo_packettype) { switch (ndo->ndo_packettype) {
case PT_ZMTP1: case PT_ZMTP1:
zmtp1_print(ndo, bp, length); zmtp1_print(ndo, bp, length);
break; break;
 End of changes. 5 change blocks. 
2 lines changed or deleted 30 lines changed or added

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