From 6d59e2f382406def185ce5261b8723a174cd28a3 Mon Sep 17 00:00:00 2001 From: Rui Paulo Date: Thu, 28 Oct 2010 16:23:25 +0000 Subject: Update tcpdump to 4.1.1. Changes: Thu. April 1, 2010. guy@alum.mit.edu. Summary for 4.1.1 tcpdump release Fix build on systems with PF, such as FreeBSD and OpenBSD. Don't blow up if a zero-length link-layer address is passed to linkaddr_string(). Thu. March 11, 2010. ken@netfunctional.ca/guy@alum.mit.edu. Summary for 4.1.0 tcpdump release Fix printing of MAC addresses for VLAN frames with a length field Add some additional bounds checks and use the EXTRACT_ macros more Add a -b flag to print the AS number in BGP packets in ASDOT notation rather than ASPLAIN notation Add ICMPv6 RFC 5006 support Decode the access flags in NFS access requests Handle the new DLT_ for memory-mapped USB captures on Linux Make the default snapshot (-s) the maximum Print name of device (when -L is used) Support for OpenSolaris (and SXCE build 125 and later) Print new TCP flags Add support for RPL DIO Add support for TCP User Timeout (UTO) Add support for non-standard Ethertypes used by 3com PPPoE gear Add support for 802.11n and 802.11s Add support for Transparent Ethernet Bridge ethertype in GRE Add 4 byte AS support for BGP printer Add support for the MDT SAFI 66 BG printer Add basic IPv6 support to print-olsr Add USB printer Add printer for ForCES Handle frames with an FCS Handle 802.11n Control Wrapper, Block Acq Req and Block Ack frames Fix TCP sequence number printing Report 802.2 packets as 802.2 instead of 802.3 Don't include -L/usr/lib in LDFLAGS On x86_64 Linux, look in lib64 directory too Lots of code clean ups Autoconf clean ups Update testcases to make output changes Fix compiling with/out smi (--with{,out}-smi) Fix compiling without IPv6 support (--disable-ipv6) --- print-l2tp.c | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) (limited to 'print-l2tp.c') diff --git a/print-l2tp.c b/print-l2tp.c index 55c2125174ee9..2f726574e4ee3 100644 --- a/print-l2tp.c +++ b/print-l2tp.c @@ -606,7 +606,7 @@ l2tp_avp_print(const u_char *dat, int length) void l2tp_print(const u_char *dat, u_int length) { - const u_int16_t *ptr = (u_int16_t *)dat; + const u_char *ptr = dat; u_int cnt = 0; /* total octets consumed */ u_int16_t pad; int flag_t, flag_l, flag_s, flag_o; @@ -614,7 +614,7 @@ l2tp_print(const u_char *dat, u_int length) flag_t = flag_l = flag_s = flag_o = FALSE; - TCHECK(*ptr); /* Flags & Version */ + TCHECK2(*ptr, 2); /* Flags & Version */ if ((EXTRACT_16BITS(ptr) & L2TP_VERSION_MASK) == L2TP_VERSION_L2TP) { printf(" l2tp:"); } else if ((EXTRACT_16BITS(ptr) & L2TP_VERSION_MASK) == L2TP_VERSION_L2F) { @@ -646,37 +646,42 @@ l2tp_print(const u_char *dat, u_int length) printf("P"); printf("]"); - ptr++; + ptr += 2; cnt += 2; if (flag_l) { - TCHECK(*ptr); /* Length */ - l2tp_len = EXTRACT_16BITS(ptr); ptr++; + TCHECK2(*ptr, 2); /* Length */ + l2tp_len = EXTRACT_16BITS(ptr); + ptr += 2; cnt += 2; } else { l2tp_len = 0; } - TCHECK(*ptr); /* Tunnel ID */ - printf("(%u/", EXTRACT_16BITS(ptr)); ptr++; + TCHECK2(*ptr, 2); /* Tunnel ID */ + printf("(%u/", EXTRACT_16BITS(ptr)); + ptr += 2; cnt += 2; - TCHECK(*ptr); /* Session ID */ - printf("%u)", EXTRACT_16BITS(ptr)); ptr++; + TCHECK2(*ptr, 2); /* Session ID */ + printf("%u)", EXTRACT_16BITS(ptr)); + ptr += 2; cnt += 2; if (flag_s) { - TCHECK(*ptr); /* Ns */ - printf("Ns=%u,", EXTRACT_16BITS(ptr)); ptr++; + TCHECK2(*ptr, 2); /* Ns */ + printf("Ns=%u,", EXTRACT_16BITS(ptr)); + ptr += 2; cnt += 2; - TCHECK(*ptr); /* Nr */ - printf("Nr=%u", EXTRACT_16BITS(ptr)); ptr++; + TCHECK2(*ptr, 2); /* Nr */ + printf("Nr=%u", EXTRACT_16BITS(ptr)); + ptr += 2; cnt += 2; } if (flag_o) { - TCHECK(*ptr); /* Offset Size */ - pad = EXTRACT_16BITS(ptr); ptr++; - ptr += pad / sizeof(*ptr); + TCHECK2(*ptr, 2); /* Offset Size */ + pad = EXTRACT_16BITS(ptr); + ptr += (2 + pad); cnt += (2 + pad); } @@ -699,11 +704,11 @@ l2tp_print(const u_char *dat, u_int length) if (length - cnt == 0) { printf(" ZLB"); } else { - l2tp_avp_print((u_char *)ptr, length - cnt); + l2tp_avp_print(ptr, length - cnt); } } else { printf(" {"); - ppp_print((u_char *)ptr, length - cnt); + ppp_print(ptr, length - cnt); printf("}"); } -- cgit v1.2.3