diff options
author | bms <bms@FreeBSD.org> | 2005-12-13 08:13:51 +0800 |
---|---|---|
committer | bms <bms@FreeBSD.org> | 2005-12-13 08:13:51 +0800 |
commit | 6543cd87f6fa2ce441e9a038a75c2c0f91a10af5 (patch) | |
tree | 0bf6712f2b0dca5f49a6184ebcaf2716905ef69d | |
parent | d58a0ab697d35d4f10cd647f2e532071af1b89ad (diff) | |
download | freebsd-ports-gnome-6543cd87f6fa2ce441e9a038a75c2c0f91a10af5.tar.gz freebsd-ports-gnome-6543cd87f6fa2ce441e9a038a75c2c0f91a10af5.tar.zst freebsd-ports-gnome-6543cd87f6fa2ce441e9a038a75c2c0f91a10af5.zip |
Update to libpcap 0.9.4 and tcpdump 3.9.4.
Add new MASTER_SITE mirror icrew.org.
-rw-r--r-- | net/libpcap/Makefile | 6 | ||||
-rw-r--r-- | net/libpcap/distinfo | 5 | ||||
-rw-r--r-- | net/tcpdump/Makefile | 37 | ||||
-rw-r--r-- | net/tcpdump/distinfo | 5 | ||||
-rw-r--r-- | net/tcpdump/files/extra-patch-extract.h | 15 | ||||
-rw-r--r-- | net/tcpdump/files/extra-patch-ieee802_11_radio.h | 206 | ||||
-rw-r--r-- | net/tcpdump/files/extra-patch-openssl-configure.in | 11 | ||||
-rw-r--r-- | net/tcpdump/files/extra-patch-print-802_11.c | 297 | ||||
-rw-r--r-- | net/tcpdump/files/extra-patch-tcpmd5-print-tcp.c | 112 | ||||
-rw-r--r-- | net/tcpdump/files/extra-patch-tcpmd5-tcp.h | 19 | ||||
-rw-r--r-- | net/tcpdump/files/patch-infinite-loop-dos | 99 | ||||
-rw-r--r-- | net/tcpdump/files/patch-print-ppp.c | 227 |
12 files changed, 14 insertions, 1025 deletions
diff --git a/net/libpcap/Makefile b/net/libpcap/Makefile index 9ea772180f4f..ce8899a25837 100644 --- a/net/libpcap/Makefile +++ b/net/libpcap/Makefile @@ -6,10 +6,10 @@ # PORTNAME= libpcap -PORTVERSION= 0.8.3 -PORTREVISION= 1 +PORTVERSION= 0.9.4 CATEGORIES= net -MASTER_SITES= http://www.tcpdump.org/release/ +MASTER_SITES= http://www.tcpdump.org/release/ \ + http://www.icrew.org/mirror/tcp_dump/tcpdump_3_9/ DISTNAME= ${PORTNAME}-${PORTVERSION} MAINTAINER= bms@FreeBSD.org diff --git a/net/libpcap/distinfo b/net/libpcap/distinfo index adf83ff8012b..1a198e96923b 100644 --- a/net/libpcap/distinfo +++ b/net/libpcap/distinfo @@ -1,2 +1,3 @@ -MD5 (libpcap-0.8.3.tar.gz) = 56a9d4615d8354fcfe8cff8c8443c77b -SIZE (libpcap-0.8.3.tar.gz) = 302551 +MD5 (libpcap-0.9.4.tar.gz) = 79025766e8027df154cb1f32de8a7974 +SHA256 (libpcap-0.9.4.tar.gz) = 379cf6a5b4a68d9cb9431c018a3402196547cba36ffc958927cacd038cb50c60 +SIZE (libpcap-0.9.4.tar.gz) = 425887 diff --git a/net/tcpdump/Makefile b/net/tcpdump/Makefile index 70548add5aeb..0d8dbe8fb94b 100644 --- a/net/tcpdump/Makefile +++ b/net/tcpdump/Makefile @@ -6,10 +6,10 @@ # PORTNAME= tcpdump -PORTVERSION= 3.8.3 -PORTREVISION= 2 +PORTVERSION= 3.9.4 CATEGORIES= net -MASTER_SITES= http://www.tcpdump.org/release/ +MASTER_SITES= http://www.tcpdump.org/release/ \ + http://www.icrew.org/mirror/tcp_dump/tcpdump_3_9/ DISTNAME= ${PORTNAME}-${PORTVERSION} MAINTAINER= bms@FreeBSD.org @@ -51,46 +51,23 @@ PLIST_SUB+= NOTBASE="" # WITHOUT_CRYPTO Build without IPSEC or TCPMD5 decryption. # WITHOUT_IPV6 Build without IPV6 support. # WITH_LIBPCAP_BASE Use libpcap from the base system instead of ports. -# WITH_RADIOTAP Build with support for BSD 802.11 Radiotap headers. -# WITH_TCPMD5 Build with support for TCP-MD5 digest verification. # -# Defaults: WITHOUT_LIBPCAP_PORT WITHOUT_RADIOTAP WITHOUT_TCPMD5 -# WITH_CRYPTO WITH_IPV6 +# Defaults: WITHOUT_LIBPCAP_BASE WITH_CRYPTO WITH_IPV6 # The --without-crypto flag needs to be explicitly specified. The # configure script gets confused if you specify --with-crypto and # thinks this means you *don't* want crypto. -# If crypto is requested, then apply a patch to fix the detection -# of OpenSSL versions > 0.9.7d. We assume the installed version is -# at least this recent; this may fail on older systems. # .if defined(WITHOUT_CRYPTO) CONFIGURE_ARGS+= --without-crypto .else USE_OPENSSL= defined -USE_AUTOTOOLS= autoconf:253 -EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-openssl-configure.in .endif .if !defined(WITHOUT_IPV6) CONFIGURE_ARGS+= --enable-ipv6 .endif -.if defined(WITH_RADIOTAP) -EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-extract.h \ - ${PATCHDIR}/extra-patch-ieee802_11_radio.h \ - ${PATCHDIR}/extra-patch-print-802_11.c -.endif - -.if defined(WITH_TCPMD5) -.if defined(WITHOUT_CRYPTO) -BROKEN= "The use of WITH_TCPMD5 requires crypto support." -.else -EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-tcpmd5-print-tcp.c \ - ${PATCHDIR}/extra-patch-tcpmd5-tcp.h -.endif -.endif - # When compiling against the port, it's necessary to force the # port to look for libpcap in ${LOCALPCAPBASE} first, for both # the configure and build steps. @@ -104,14 +81,10 @@ LOCALPCAPBASE= /usr LOCALPCAPFILES= include/pcap.h include/pcap-namedb.h include/pcap-bpf.h \ lib/libpcap.a -WRKPCAPDIR= ${WRKDIR}/libpcap-0.8.3 +WRKPCAPDIR= ${WRKDIR}/libpcap-0.9.4 .include <bsd.port.pre.mk> -.if ${OSVERSION} >= 503000 && !defined(TCPDUMP_OVERWRITE_BASE) -IGNORE= Already in base system -.endif - # When building tcpdump against a particular pcap version, it expects to # find a built, untarred source tree in the parent of the work tree. # Build a symlink farm which points to the installed versions of the diff --git a/net/tcpdump/distinfo b/net/tcpdump/distinfo index b6239aac01c5..504da152c8b8 100644 --- a/net/tcpdump/distinfo +++ b/net/tcpdump/distinfo @@ -1,2 +1,3 @@ -MD5 (tcpdump-3.8.3.tar.gz) = 30645001f4b97019677cad88d3811904 -SIZE (tcpdump-3.8.3.tar.gz) = 567116 +MD5 (tcpdump-3.9.4.tar.gz) = 4b64755bbc8ba1af49c747271a6df5b8 +SHA256 (tcpdump-3.9.4.tar.gz) = 7ee770a16cab2ed69b9c84f8d4fec0d63e09a004994eb368adc31eed8db373b5 +SIZE (tcpdump-3.9.4.tar.gz) = 716862 diff --git a/net/tcpdump/files/extra-patch-extract.h b/net/tcpdump/files/extra-patch-extract.h deleted file mode 100644 index 0557722c67f2..000000000000 --- a/net/tcpdump/files/extra-patch-extract.h +++ /dev/null @@ -1,15 +0,0 @@ ---- extract.h.orig Tue Dec 10 23:13:51 2002 -+++ extract.h Tue Mar 30 20:38:35 2004 -@@ -96,3 +96,12 @@ - (u_int32_t)*((const u_int8_t *)(p) + 2) << 16 | \ - (u_int32_t)*((const u_int8_t *)(p) + 1) << 8 | \ - (u_int32_t)*((const u_int8_t *)(p) + 0))) -+#define EXTRACT_LE_64BITS(p) \ -+ ((u_int64_t)((u_int64_t)*((const u_int8_t *)(p) + 7) << 56 | \ -+ (u_int64_t)*((const u_int8_t *)(p) + 6) << 48 | \ -+ (u_int64_t)*((const u_int8_t *)(p) + 5) << 40 | \ -+ (u_int64_t)*((const u_int8_t *)(p) + 4) << 32 | \ -+ (u_int64_t)*((const u_int8_t *)(p) + 3) << 24 | \ -+ (u_int64_t)*((const u_int8_t *)(p) + 2) << 16 | \ -+ (u_int64_t)*((const u_int8_t *)(p) + 1) << 8 | \ -+ (u_int64_t)*((const u_int8_t *)(p) + 0))) diff --git a/net/tcpdump/files/extra-patch-ieee802_11_radio.h b/net/tcpdump/files/extra-patch-ieee802_11_radio.h deleted file mode 100644 index 5851fe5ca4ef..000000000000 --- a/net/tcpdump/files/extra-patch-ieee802_11_radio.h +++ /dev/null @@ -1,206 +0,0 @@ ---- ieee802_11_radio.h.orig Tue Mar 30 20:38:35 2004 -+++ ieee802_11_radio.h Wed Mar 31 10:51:15 2004 -@@ -0,0 +1,203 @@ -+/* $FreeBSD: /tmp/pcvs/ports/net/tcpdump/files/Attic/extra-patch-ieee802_11_radio.h,v 1.3 2004-04-03 06:24:17 bms Exp $ */ -+/* $NetBSD: ieee80211_radiotap.h,v 1.3 2003/11/16 09:02:42 dyoung Exp $ */ -+/* $Header$ */ -+ -+/*- -+ * Copyright (c) 2003, 2004 David Young. All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * 3. The name of David Young may not be used to endorse or promote -+ * products derived from this software without specific prior -+ * written permission. -+ * -+ * THIS SOFTWARE IS PROVIDED BY DAVID YOUNG ``AS IS'' AND ANY -+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -+ * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DAVID -+ * YOUNG BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY -+ * OF SUCH DAMAGE. -+ */ -+#ifndef _NET_IF_IEEE80211RADIOTAP_H_ -+#define _NET_IF_IEEE80211RADIOTAP_H_ -+ -+/* A generic radio capture format is desirable. There is one for -+ * Linux, but it is neither rigidly defined (there were not even -+ * units given for some fields) nor easily extensible. -+ * -+ * I suggest the following extensible radio capture format. It is -+ * based on a bitmap indicating which fields are present. -+ * -+ * I am trying to describe precisely what the application programmer -+ * should expect in the following, and for that reason I tell the -+ * units and origin of each measurement (where it applies), or else I -+ * use sufficiently weaselly language ("is a monotonically nondecreasing -+ * function of...") that I cannot set false expectations for lawyerly -+ * readers. -+ */ -+#ifdef _KERNEL -+#ifndef DLT_IEEE802_11_RADIO -+#define DLT_IEEE802_11_RADIO 127 /* 802.11 plus WLAN header */ -+#endif -+#endif /* _KERNEL */ -+ -+/* The radio capture header precedes the 802.11 header. */ -+struct ieee80211_radiotap_header { -+ u_int8_t it_version; /* Version 0. Only increases -+ * for drastic changes, -+ * introduction of compatible -+ * new fields does not count. -+ */ -+ u_int8_t it_pad; -+ u_int16_t it_len; /* length of the whole -+ * header in bytes, including -+ * it_version, it_pad, -+ * it_len, and data fields. -+ */ -+ u_int32_t it_present; /* A bitmap telling which -+ * fields are present. Set bit 31 -+ * (0x80000000) to extend the -+ * bitmap by another 32 bits. -+ * Additional extensions are made -+ * by setting bit 31. -+ */ -+} __attribute__((__packed__)); -+ -+/* Name Data type Units -+ * ---- --------- ----- -+ * -+ * IEEE80211_RADIOTAP_TSFT u_int64_t microseconds -+ * -+ * Value in microseconds of the MAC's 64-bit 802.11 Time -+ * Synchronization Function timer when the first bit of the -+ * MPDU arrived at the MAC. For received frames, only. -+ * -+ * IEEE80211_RADIOTAP_CHANNEL 2 x u_int16_t MHz, bitmap -+ * -+ * Tx/Rx frequency in MHz, followed by flags (see below). -+ * -+ * IEEE80211_RADIOTAP_FHSS u_int16_t see below -+ * -+ * For frequency-hopping radios, the hop set (first byte) -+ * and pattern (second byte). -+ * -+ * IEEE80211_RADIOTAP_RATE u_int8_t 500kb/s -+ * -+ * Tx/Rx data rate -+ * -+ * IEEE80211_RADIOTAP_DBM_ANTSIGNAL int8_t decibels from -+ * one milliwatt (dBm) -+ * -+ * RF signal power at the antenna, decibel difference from -+ * one milliwatt. -+ * -+ * IEEE80211_RADIOTAP_DBM_ANTNOISE int8_t decibels from -+ * one milliwatt (dBm) -+ * -+ * RF noise power at the antenna, decibel difference from one -+ * milliwatt. -+ * -+ * IEEE80211_RADIOTAP_DB_ANTSIGNAL u_int8_t decibel (dB) -+ * -+ * RF signal power at the antenna, decibel difference from an -+ * arbitrary, fixed reference. -+ * -+ * IEEE80211_RADIOTAP_DB_ANTNOISE u_int8_t decibel (dB) -+ * -+ * RF noise power at the antenna, decibel difference from an -+ * arbitrary, fixed reference point. -+ * -+ * IEEE80211_RADIOTAP_BARKER_CODE_LOCK u_int16_t unitless -+ * -+ * Quality of Barker code lock. Unitless. Monotonically -+ * nondecreasing with "better" lock strength. Called "Signal -+ * Quality" in datasheets. (Is there a standard way to measure -+ * this?) -+ * -+ * IEEE80211_RADIOTAP_TX_ATTENUATION u_int16_t unitless -+ * -+ * Transmit power expressed as unitless distance from max -+ * power set at factory calibration. 0 is max power. -+ * Monotonically nondecreasing with lower power levels. -+ * -+ * IEEE80211_RADIOTAP_DB_TX_ATTENUATION u_int16_t decibels (dB) -+ * -+ * Transmit power expressed as decibel distance from max power -+ * set at factory calibration. 0 is max power. Monotonically -+ * nondecreasing with lower power levels. -+ * -+ * IEEE80211_RADIOTAP_DBM_TX_POWER int8_t decibels from -+ * one milliwatt (dBm) -+ * -+ * Transmit power expressed as dBm (decibels from a 1 milliwatt -+ * reference). This is the absolute power level measured at -+ * the antenna port. -+ * -+ * IEEE80211_RADIOTAP_FLAGS u_int8_t bitmap -+ * -+ * Properties of transmitted and received frames. See flags -+ * defined below. -+ * -+ * IEEE80211_RADIOTAP_ANTENNA u_int8_t antenna index -+ * -+ * Unitless indication of the Rx/Tx antenna for this packet. -+ * The first antenna is antenna 0. -+ */ -+enum ieee80211_radiotap_type { -+ IEEE80211_RADIOTAP_TSFT = 0, -+ IEEE80211_RADIOTAP_FLAGS = 1, -+ IEEE80211_RADIOTAP_RATE = 2, -+ IEEE80211_RADIOTAP_CHANNEL = 3, -+ IEEE80211_RADIOTAP_FHSS = 4, -+ IEEE80211_RADIOTAP_DBM_ANTSIGNAL = 5, -+ IEEE80211_RADIOTAP_DBM_ANTNOISE = 6, -+ IEEE80211_RADIOTAP_LOCK_QUALITY = 7, -+ IEEE80211_RADIOTAP_TX_ATTENUATION = 8, -+ IEEE80211_RADIOTAP_DB_TX_ATTENUATION = 9, -+ IEEE80211_RADIOTAP_DBM_TX_POWER = 10, -+ IEEE80211_RADIOTAP_ANTENNA = 11, -+ IEEE80211_RADIOTAP_DB_ANTSIGNAL = 12, -+ IEEE80211_RADIOTAP_DB_ANTNOISE = 13, -+ IEEE80211_RADIOTAP_EXT = 31 -+}; -+ -+#ifndef _KERNEL -+/* Channel flags. */ -+#define IEEE80211_CHAN_TURBO 0x0010 /* Turbo channel */ -+#define IEEE80211_CHAN_CCK 0x0020 /* CCK channel */ -+#define IEEE80211_CHAN_OFDM 0x0040 /* OFDM channel */ -+#define IEEE80211_CHAN_2GHZ 0x0080 /* 2 GHz spectrum channel. */ -+#define IEEE80211_CHAN_5GHZ 0x0100 /* 5 GHz spectrum channel */ -+#define IEEE80211_CHAN_PASSIVE 0x0200 /* Only passive scan allowed */ -+#define IEEE80211_CHAN_DYN 0x0400 /* Dynamic CCK-OFDM channel */ -+#define IEEE80211_CHAN_GFSK 0x0800 /* GFSK channel (FHSS PHY) */ -+#endif /* !_KERNEL */ -+ -+/* For IEEE80211_RADIOTAP_FLAGS */ -+#define IEEE80211_RADIOTAP_F_CFP 0x01 /* sent/received -+ * during CFP -+ */ -+#define IEEE80211_RADIOTAP_F_SHORTPRE 0x02 /* sent/received -+ * with short -+ * preamble -+ */ -+#define IEEE80211_RADIOTAP_F_WEP 0x04 /* sent/received -+ * with WEP encryption -+ */ -+#define IEEE80211_RADIOTAP_F_FRAG 0x08 /* sent/received -+ * with fragmentation -+ */ -+ -+#endif /* _NET_IF_IEEE80211RADIOTAP_H_ */ diff --git a/net/tcpdump/files/extra-patch-openssl-configure.in b/net/tcpdump/files/extra-patch-openssl-configure.in deleted file mode 100644 index a3e078a36173..000000000000 --- a/net/tcpdump/files/extra-patch-openssl-configure.in +++ /dev/null @@ -1,11 +0,0 @@ ---- configure.in.orig Sat Jan 22 23:59:33 2005 -+++ configure.in Sun Jan 23 00:00:19 2005 -@@ -732,7 +732,7 @@ - if test -f $ac_cv_ssleay_path/lib/librsaref.a; then - LIBS="$LIBS -lrsaref" - fi -- AC_CHECK_LIB(crypto, des_cbc_encrypt) -+ AC_CHECK_LIB(crypto, DES_cbc_encrypt) - - CPPFLAGS="$CPPFLAGS $V_INCLS" - AC_CHECK_HEADERS(openssl/evp.h) diff --git a/net/tcpdump/files/extra-patch-print-802_11.c b/net/tcpdump/files/extra-patch-print-802_11.c deleted file mode 100644 index 9166b213ad69..000000000000 --- a/net/tcpdump/files/extra-patch-print-802_11.c +++ /dev/null @@ -1,297 +0,0 @@ ---- print-802_11.c.orig Wed Dec 10 01:52:33 2003 -+++ print-802_11.c Wed Mar 31 11:51:54 2004 -@@ -42,14 +42,17 @@ - #include "extract.h" - - #include "ieee802_11.h" -+#include "ieee802_11_radio.h" - -+#define PRINT_RATE(_sep, _r, _suf) \ -+ printf("%s%2.1f%s", _sep, (.5 * ((_r) & 0x7f)), _suf) - #define PRINT_RATES(p) \ - do { \ - int z; \ - const char *sep = " ["; \ - for (z = 0; z < p.rates.length ; z++) { \ -- printf("%s%2.1f", sep, (.5 * (p.rates.rate[z] & 0x7f))); \ -- if (p.rates.rate[z] & 0x80) printf("*"); \ -+ PRINT_RATE(sep, p.rates.rate[z], \ -+ (p.rates.rate[z] & 0x80 ? "*" : "")); \ - sep = " "; \ - } \ - if (p.rates.length != 0) \ -@@ -919,9 +922,265 @@ - return ieee802_11_print(p, h->len, h->caplen); - } - -+/* -+ * Useful combinations of channel characteristics. -+ */ -+#define IEEE80211_CHAN_FHSS \ -+ (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_GFSK) -+#define IEEE80211_CHAN_A \ -+ (IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_OFDM) -+#define IEEE80211_CHAN_B \ -+ (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_CCK) -+#define IEEE80211_CHAN_PUREG \ -+ (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_OFDM) -+#define IEEE80211_CHAN_G \ -+ (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_DYN) -+#define IEEE80211_CHAN_T \ -+ (IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_OFDM | IEEE80211_CHAN_TURBO) -+ -+#define IEEE80211_IS_CHAN_FHSS(_flags) \ -+ (((_flags) & IEEE80211_CHAN_FHSS) == IEEE80211_CHAN_FHSS) -+#define IEEE80211_IS_CHAN_A(_flags) \ -+ (((_flags) & IEEE80211_CHAN_A) == IEEE80211_CHAN_A) -+#define IEEE80211_IS_CHAN_B(_flags) \ -+ (((_flags) & IEEE80211_CHAN_B) == IEEE80211_CHAN_B) -+#define IEEE80211_IS_CHAN_PUREG(_flags) \ -+ (((_flags) & IEEE80211_CHAN_PUREG) == IEEE80211_CHAN_PUREG) -+#define IEEE80211_IS_CHAN_G(_flags) \ -+ (((_flags) & IEEE80211_CHAN_G) == IEEE80211_CHAN_G) -+#define IEEE80211_IS_CHAN_T(_flags) \ -+ (((_flags) & IEEE80211_CHAN_T) == IEEE80211_CHAN_T) -+ - static u_int - ieee802_11_radio_print(const u_char *p, u_int length, u_int caplen) - { -+#define BITNO_32(x) (((x) >> 16) ? 16 + BITNO_16((x) >> 16) : BITNO_16((x))) -+#define BITNO_16(x) (((x) >> 8) ? 8 + BITNO_8((x) >> 8) : BITNO_8((x))) -+#define BITNO_8(x) (((x) >> 4) ? 4 + BITNO_4((x) >> 4) : BITNO_4((x))) -+#define BITNO_4(x) (((x) >> 2) ? 2 + BITNO_2((x) >> 2) : BITNO_2((x))) -+#define BITNO_2(x) (((x) & 2) ? 1 : 0) -+#define BIT(n) (1 << n) -+ -+#define CHECK_EXTRACT_LE_8BITS(_v,_bad) do { \ -+ if (iter + sizeof(u_int8_t) > iterlast) { \ -+ _bad; \ -+ } \ -+ _v = EXTRACT_LE_8BITS(iter); \ -+ iter += sizeof(u_int8_t); \ -+} while (0) -+#define CHECK_EXTRACT_LE_16BITS(_v,_bad) do { \ -+ if (iter + sizeof(u_int16_t) > iterlast) { \ -+ _bad; \ -+ } \ -+ _v = EXTRACT_LE_16BITS(iter); \ -+ iter += sizeof(u_int16_t); \ -+} while (0) -+#define CHECK_EXTRACT_LE_64BITS(_v,_bad) do { \ -+ if (iter + sizeof(u_int64_t) > iterlast) { \ -+ _bad; \ -+ } \ -+ _v = EXTRACT_LE_64BITS(iter); \ -+ iter += sizeof(u_int64_t); \ -+} while (0) -+ -+ struct ieee80211_radiotap_header *hdr; -+ u_int32_t present, next_present; -+ u_int32_t *presentp, *last_presentp; -+ enum ieee80211_radiotap_type bit; -+ int bit0, len; -+ const u_int8_t *iter; -+ const u_int8_t *iterlast; -+ union { -+ int8_t i8; -+ u_int8_t u8; -+ int16_t i16; -+ u_int16_t u16; -+ u_int32_t u32; -+ u_int64_t u64; -+ } u, u2; -+ -+ if (caplen < sizeof(*hdr)) { -+ printf("[|802.11]"); -+ return caplen; -+ } -+ -+ hdr = (struct ieee80211_radiotap_header *)p; -+ -+ len = EXTRACT_LE_16BITS(&hdr->it_len); -+ if (caplen < len) { -+ printf("[|802.11]"); -+ return caplen; -+ } -+ -+ for (last_presentp = &hdr->it_present; -+ (*last_presentp & BIT(IEEE80211_RADIOTAP_EXT)) != 0 && -+ (u_char*)(last_presentp + 1) <= p + len; -+ last_presentp++); -+ -+ /* are there more bitmap extensions than bytes in header? */ -+ if ((*last_presentp & BIT(IEEE80211_RADIOTAP_EXT)) != 0) { -+ printf("[|802.11]"); -+ return caplen; -+ } -+ -+ iter = (u_char*)(last_presentp + 1); -+ iterlast = (u_char*)(p + len); -+ -+ for (bit0 = 0, presentp = &hdr->it_present; presentp <= last_presentp; -+ presentp++, bit0 += 32) { -+ present = EXTRACT_LE_32BITS(presentp); -+ for (; present; present = next_present) { -+ /* clear the least significant bit that is set */ -+ next_present = present & (present - 1); -+ -+ /* extract the least significant bit that is set */ -+ bit = bit0 + BITNO_32(present ^ next_present); -+ -+ switch (bit) { -+ case IEEE80211_RADIOTAP_FLAGS: -+ case IEEE80211_RADIOTAP_RATE: -+ case IEEE80211_RADIOTAP_DB_ANTSIGNAL: -+ case IEEE80211_RADIOTAP_DB_ANTNOISE: -+ case IEEE80211_RADIOTAP_ANTENNA: -+ case IEEE80211_RADIOTAP_DB_TX_ATTENUATION: -+ CHECK_EXTRACT_LE_8BITS(u.u8, goto bad); -+ break; -+ case IEEE80211_RADIOTAP_DBM_ANTSIGNAL: -+ case IEEE80211_RADIOTAP_DBM_ANTNOISE: -+ case IEEE80211_RADIOTAP_DBM_TX_POWER: -+ CHECK_EXTRACT_LE_8BITS(u.i8, goto bad); -+ break; -+ case IEEE80211_RADIOTAP_FHSS: -+ case IEEE80211_RADIOTAP_LOCK_QUALITY: -+ case IEEE80211_RADIOTAP_TX_ATTENUATION: -+ case IEEE80211_RADIOTAP_CHANNEL: -+ CHECK_EXTRACT_LE_16BITS(u.u16, goto bad); -+ if (bit == IEEE80211_RADIOTAP_CHANNEL) -+ CHECK_EXTRACT_LE_16BITS(u2.u16, -+ goto bad); -+ break; -+ case IEEE80211_RADIOTAP_TSFT: -+ CHECK_EXTRACT_LE_64BITS(u.u64, goto bad); -+ break; -+ default: -+ /* this bit indicates a field whose -+ * size we do not know, so we cannot -+ * proceed. -+ */ -+ printf("[0x%08x] ", bit); -+ return -1; -+ bad: -+ /* -+ * There wasn't enough data for the -+ * data type; stop decoding. -+ */ -+ printf("[|802.11]"); -+ goto out; -+ } -+ -+ switch (bit) { -+ case IEEE80211_RADIOTAP_CHANNEL: -+ printf("%u MHz ", u.u16); -+ if (u2.u16 != 0) { -+ /* use flags to disambiguate */ -+ if (IEEE80211_IS_CHAN_G(u2.u16) || -+ IEEE80211_IS_CHAN_PUREG(u2.u16)) -+ printf("(11g) ", u2.u16); -+ else if (IEEE80211_IS_CHAN_T(u2.u16)) -+ printf("(turbo) ", u2.u16); -+ else if (IEEE80211_IS_CHAN_B(u2.u16)) -+ ; -+ else if (IEEE80211_IS_CHAN_A(u2.u16)) -+ ; -+ else if (IEEE80211_IS_CHAN_FHSS(u2.u16)) -+ ; -+ else -+ printf("(0x%04x) ", u2.u16); -+ } -+ break; -+ case IEEE80211_RADIOTAP_FHSS: -+ printf("fhset %d fhpat %d ", -+ u.u16 & 0xff, (u.u16 >> 8) & 0xff); -+ break; -+ case IEEE80211_RADIOTAP_RATE: -+ PRINT_RATE("", u.u8, " Mb/s "); -+ break; -+ case IEEE80211_RADIOTAP_DBM_ANTSIGNAL: -+ printf("%ddB signal ", u.i8); -+ break; -+ case IEEE80211_RADIOTAP_DBM_ANTNOISE: -+ printf("%ddB noise ", u.i8); -+ break; -+ case IEEE80211_RADIOTAP_DB_ANTSIGNAL: -+ printf("%ddB signal ", u.u8); -+ break; -+ case IEEE80211_RADIOTAP_DB_ANTNOISE: -+ printf("%ddB noise ", u.u8); -+ break; -+ case IEEE80211_RADIOTAP_LOCK_QUALITY: -+ printf("%u sq ", u.u16); -+ break; -+ case IEEE80211_RADIOTAP_TX_ATTENUATION: -+ printf("%d tx power ", -(int)u.u16); -+ break; -+ case IEEE80211_RADIOTAP_DB_TX_ATTENUATION: -+ printf("%ddB tx power ", -(int)u.u8); -+ break; -+ case IEEE80211_RADIOTAP_DBM_TX_POWER: -+ printf("%ddBm tx power ", u.i8); -+ break; -+ case IEEE80211_RADIOTAP_FLAGS: -+ if (u.u8 & IEEE80211_RADIOTAP_F_CFP) -+ printf("cfp "); -+ if (u.u8 & IEEE80211_RADIOTAP_F_SHORTPRE) -+ printf("short preamble "); -+ if (u.u8 & IEEE80211_RADIOTAP_F_WEP) -+ printf("wep "); -+ if (u.u8 & IEEE80211_RADIOTAP_F_FRAG) -+ printf("fragmented "); -+ break; -+ case IEEE80211_RADIOTAP_ANTENNA: -+ printf("antenna %d ", u.u8); -+ break; -+ case IEEE80211_RADIOTAP_TSFT: -+ printf("%lldus tsft ", (long long)u.u64); -+ break; -+ } -+ } -+ } -+out: -+ -+ return len + ieee802_11_print(p + len, length - len, caplen - len); -+ -+#undef CHECK_EXTRACT_8BITS -+#undef CHECK_EXTRACT_LE_16BITS -+#undef CHECK_EXTRACT_LE_64BITS -+ -+#undef BITNO_32 -+#undef BITNO_16 -+#undef BITNO_8 -+#undef BITNO_4 -+#undef BITNO_2 -+#undef BIT -+} -+ -+#undef IEEE80211_CHAN_FHSS -+#undef IEEE80211_CHAN_A -+#undef IEEE80211_CHAN_B -+#undef IEEE80211_CHAN_PUREG -+#undef IEEE80211_CHAN_G -+#undef IEEE80211_CHAN_T -+ -+#undef IEEE80211_IS_CHAN_FHSS -+#undef IEEE80211_IS_CHAN_A -+#undef IEEE80211_IS_CHAN_B -+#undef IEEE80211_IS_CHAN_PUREG -+#undef IEEE80211_IS_CHAN_G -+#undef IEEE80211_IS_CHAN_T -+ -+static u_int -+ieee802_11_avs_radio_print(const u_char *p, u_int length, u_int caplen) -+{ - u_int32_t caphdr_len; - - caphdr_len = EXTRACT_32BITS(p + 4); -@@ -972,7 +1231,7 @@ - } - - if (EXTRACT_32BITS(p) == WLANCAP_MAGIC_COOKIE_V1) -- return ieee802_11_radio_print(p, length, caplen); -+ return ieee802_11_avs_radio_print(p, length, caplen); - - if (caplen < PRISM_HDR_LEN) { - printf("[|802.11]"); diff --git a/net/tcpdump/files/extra-patch-tcpmd5-print-tcp.c b/net/tcpdump/files/extra-patch-tcpmd5-print-tcp.c deleted file mode 100644 index bb455293d1bc..000000000000 --- a/net/tcpdump/files/extra-patch-tcpmd5-print-tcp.c +++ /dev/null @@ -1,112 +0,0 @@ ---- print-tcp.c.orig Mon Aug 2 18:47:22 2004 -+++ print-tcp.c Mon Aug 2 18:47:30 2004 -@@ -50,6 +50,13 @@ - - #include "nameser.h" - -+#ifdef HAVE_LIBCRYPTO -+#include <openssl/md5.h> -+ -+static int tcp_verify_signature(const struct ip *ip, const struct tcphdr *tp, -+ const u_char *data, int length, const u_char *rcvsig); -+#endif -+ - static void print_tcp_rst_data(register const u_char *sp, u_int length); - - #define MAX_RST_DATA_LEN 30 -@@ -561,6 +568,22 @@ - (void)printf(" %u", EXTRACT_32BITS(cp)); - break; - -+ case TCPOPT_SIGNATURE: -+ (void)printf("md5:"); -+ datalen = TCP_SIGLEN; -+ LENCHECK(datalen); -+#ifdef HAVE_LIBCRYPTO -+ if (tcp_verify_signature(ip, tp, -+ bp + TH_OFF(tp) * 4, length, cp) == 0) -+ (void)printf("valid"); -+ else -+ (void)printf("invalid"); -+#else -+ for (i = 0; i < TCP_SIGLEN; ++i) -+ (void)printf("%02x", cp[i]); -+#endif -+ break; -+ - default: - (void)printf("opt-%u:", opt); - datalen = len - 2; -@@ -673,3 +696,72 @@ - } - putchar(']'); - } -+ -+#ifdef HAVE_LIBCRYPTO -+static int -+tcp_verify_signature(const struct ip *ip, const struct tcphdr *tp, -+ const u_char *data, int length, const u_char *rcvsig) -+{ -+ struct tcphdr tp1; -+ char sig[TCP_SIGLEN]; -+ char zero_proto = 0; -+ MD5_CTX ctx; -+ u_int16_t savecsum, tlen; -+ struct ip6_hdr *ip6; -+ u_int32_t len32; -+ u_int8_t nxt; -+ -+ tp1 = *tp; -+ -+ if (tcpmd5secret == NULL) -+ return (-1); -+ -+ MD5_Init(&ctx); -+ /* -+ * Step 1: Update MD5 hash with IP pseudo-header. -+ */ -+ if (IP_V(ip) == 4) { -+ MD5_Update(&ctx, (char *)&ip->ip_src, sizeof(ip->ip_src)); -+ MD5_Update(&ctx, (char *)&ip->ip_dst, sizeof(ip->ip_dst)); -+ MD5_Update(&ctx, (char *)&zero_proto, sizeof(zero_proto)); -+ MD5_Update(&ctx, (char *)&ip->ip_p, sizeof(ip->ip_p)); -+ tlen = EXTRACT_16BITS(&ip->ip_len) - IP_HL(ip) * 4; -+ tlen = htons(tlen); -+ MD5_Update(&ctx, (char *)&tlen, sizeof(tlen)); -+ } else if (IP_V(ip) == 6) { -+ ip6 = (struct ip6_hdr *)ip; -+ MD5_Update(&ctx, (char *)&ip6->ip6_src, sizeof(ip6->ip6_src)); -+ MD5_Update(&ctx, (char *)&ip6->ip6_dst, sizeof(ip6->ip6_dst)); -+ len32 = htonl(ntohs(ip6->ip6_plen)); -+ MD5_Update(&ctx, (char *)&len32, sizeof(len32)); -+ nxt = 0; -+ MD5_Update(&ctx, (char *)&nxt, sizeof(nxt)); -+ MD5_Update(&ctx, (char *)&nxt, sizeof(nxt)); -+ MD5_Update(&ctx, (char *)&nxt, sizeof(nxt)); -+ nxt = IPPROTO_TCP; -+ MD5_Update(&ctx, (char *)&nxt, sizeof(nxt)); -+ } else -+ return (-1); -+ -+ /* -+ * Step 2: Update MD5 hash with TCP header, excluding options. -+ * The TCP checksum must be set to zero. -+ */ -+ savecsum = tp1.th_sum; -+ tp1.th_sum = 0; -+ MD5_Update(&ctx, (char *)&tp1, sizeof(struct tcphdr)); -+ tp1.th_sum = savecsum; -+ /* -+ * Step 3: Update MD5 hash with TCP segment data, if present. -+ */ -+ if (length > 0) -+ MD5_Update(&ctx, data, length); -+ /* -+ * Step 4: Update MD5 hash with shared secret. -+ */ -+ MD5_Update(&ctx, tcpmd5secret, strlen(tcpmd5secret)); -+ MD5_Final(sig, &ctx); -+ -+ return (memcmp(rcvsig, sig, 16)); -+} -+#endif /* HAVE_LIBCRYPTO */ diff --git a/net/tcpdump/files/extra-patch-tcpmd5-tcp.h b/net/tcpdump/files/extra-patch-tcpmd5-tcp.h deleted file mode 100644 index 1fee92e0175c..000000000000 --- a/net/tcpdump/files/extra-patch-tcpmd5-tcp.h +++ /dev/null @@ -1,19 +0,0 @@ ---- tcp.h.orig Tue Dec 10 23:14:11 2002 -+++ tcp.h Mon Aug 2 18:40:16 2004 -@@ -1,4 +1,4 @@ --/* @(#) $Header: /tcpdump/master/tcpdump/tcp.h,v 1.10 2002/12/11 07:14:11 guy Exp $ (LBL) */ -+/* @(#) $Header: /tcpdump/master/tcpdump/tcp.h,v 1.11 2004/03/23 07:15:37 guy Exp $ (LBL) */ - /* - * Copyright (c) 1982, 1986, 1993 - * The Regents of the University of California. All rights reserved. -@@ -75,6 +75,10 @@ - #define TCPOPT_CC 11 /* T/TCP CC options (rfc1644) */ - #define TCPOPT_CCNEW 12 /* T/TCP CC options (rfc1644) */ - #define TCPOPT_CCECHO 13 /* T/TCP CC options (rfc1644) */ -+#define TCPOPT_SIGNATURE 19 /* Keyed MD5 (rfc2385) */ -+#define TCPOLEN_SIGNATURE 18 -+ -+#define TCP_SIGLEN 16 /* length of an option 19 digest */ - - #define TCPOPT_TSTAMP_HDR \ - (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP) diff --git a/net/tcpdump/files/patch-infinite-loop-dos b/net/tcpdump/files/patch-infinite-loop-dos deleted file mode 100644 index ad0372cdcd8e..000000000000 --- a/net/tcpdump/files/patch-infinite-loop-dos +++ /dev/null @@ -1,99 +0,0 @@ -Index: print-bgp.c -=================================================================== -RCS file: /home/ncvs/src/print-bgp.c,v -retrieving revision 1.1.1.5 -diff -u -d -r1.1.1.5 print-bgp.c ---- print-bgp.c 31 Mar 2004 09:16:43 -0000 1.1.1.5 -+++ print-bgp.c 30 May 2005 21:03:44 -0000 -@@ -1216,6 +1216,8 @@ - tptr = pptr + len; - break; - } -+ if (advance < 0) /* infinite loop protection */ -+ break; - tptr += advance; - } - break; -@@ -1646,9 +1648,10 @@ - while (dat + length > p) { - char buf[MAXHOSTNAMELEN + 100]; - i = decode_prefix4(p, buf, sizeof(buf)); -- if (i == -1) -+ if (i == -1) { - printf("\n\t (illegal prefix length)"); -- else if (i == -2) -+ break; -+ } else if (i == -2) - goto trunc; - else { - printf("\n\t %s", buf); -Index: print-isoclns.c -=================================================================== -RCS file: /home/ncvs/src/print-isoclns.c,v -retrieving revision 1.12 -diff -u -d -r1.12 print-isoclns.c ---- print-isoclns.c 31 Mar 2004 14:57:24 -0000 1.12 -+++ print-isoclns.c 22 May 2005 21:49:06 -0000 -@@ -1508,6 +1508,9 @@ - tlv_type, - tlv_len); - -+ if (tlv_len == 0) /* something is malformed */ -+ break; -+ - /* now check if we have a decoder otherwise do a hexdump at the end*/ - switch (tlv_type) { - case TLV_AREA_ADDR: -@@ -1538,7 +1541,7 @@ - break; - - case TLV_ISNEIGH_VARLEN: -- if (!TTEST2(*tptr, 1)) -+ if (!TTEST2(*tptr, 1) || tmp < 3) /* min. TLV length */ - goto trunctlv; - lan_alen = *tptr++; /* LAN adress length */ - tmp --; -Index: print-ldp.c -=================================================================== -RCS file: /home/ncvs/src/print-ldp.c,v -retrieving revision 1.1.1.1 -diff -u -d -r1.1.1.1 print-ldp.c ---- print-ldp.c 31 Mar 2004 09:16:56 -0000 1.1.1.1 -+++ print-ldp.c 30 May 2005 21:11:28 -0000 -@@ -326,6 +326,9 @@ - EXTRACT_32BITS(&ldp_msg_header->id), - LDP_MASK_U_BIT(EXTRACT_16BITS(&ldp_msg_header->type)) ? "continue processing" : "ignore"); - -+ if (msg_len == 0) /* infinite loop protection */ -+ break; -+ - msg_tptr=tptr+sizeof(struct ldp_msg_header); - msg_tlen=msg_len-sizeof(struct ldp_msg_header)+4; /* Type & Length fields not included */ - -Index: print-rsvp.c -=================================================================== -RCS file: /home/ncvs/src/print-rsvp.c,v -retrieving revision 1.1.1.1 -diff -u -d -r1.1.1.1 print-rsvp.c ---- print-rsvp.c 31 Mar 2004 09:17:07 -0000 1.1.1.1 -+++ print-rsvp.c 21 May 2005 20:13:29 -0000 -@@ -875,10 +875,17 @@ - switch(rsvp_obj_ctype) { - case RSVP_CTYPE_IPV4: - while(obj_tlen >= 4 ) { -- printf("\n\t Subobject Type: %s", -+ printf("\n\t Subobject Type: %s, length %u", - tok2str(rsvp_obj_xro_values, - "Unknown %u", -- RSVP_OBJ_XRO_MASK_SUBOBJ(*obj_tptr))); -+ RSVP_OBJ_XRO_MASK_SUBOBJ(*obj_tptr)), -+ *(obj_tptr+1)); -+ -+ if (*(obj_tptr+1) == 0) { /* prevent infinite loops */ -+ printf("\n\t ERROR: zero length ERO subtype"); -+ break; -+ } -+ - switch(RSVP_OBJ_XRO_MASK_SUBOBJ(*obj_tptr)) { - case RSVP_OBJ_XRO_IPV4: - printf(", %s, %s/%u, Flags: [%s]", diff --git a/net/tcpdump/files/patch-print-ppp.c b/net/tcpdump/files/patch-print-ppp.c deleted file mode 100644 index f8161fdd822a..000000000000 --- a/net/tcpdump/files/patch-print-ppp.c +++ /dev/null @@ -1,227 +0,0 @@ ---- print-ppp.c.orig Wed Mar 24 03:32:43 2004 -+++ print-ppp.c Sun Jan 23 00:26:26 2005 -@@ -89,6 +89,7 @@ - { PPP_IPXCP, "IPXCP" }, - { PPP_STIICP, "STIICP" }, - { PPP_VINESCP, "VINESCP" }, -+ { PPP_IPV6CP, "IP6CP" }, - { PPP_MPLSCP, "MPLSCP" }, - - { PPP_LCP, "LCP" }, -@@ -211,7 +212,6 @@ - "PPP-Muxing", /* (30) */ - }; - --/* IPV6CP - to be supported */ - /* ECP - to be supported */ - - /* CCP Config Options */ -@@ -275,17 +275,36 @@ - /* SDCP - to be supported */ - - /* IPCP Config Options */ -- - #define IPCPOPT_2ADDR 1 /* RFC1172, RFC1332 (deprecated) */ - #define IPCPOPT_IPCOMP 2 /* RFC1332 */ - #define IPCPOPT_ADDR 3 /* RFC1332 */ - #define IPCPOPT_MOBILE4 4 /* RFC2290 */ -- - #define IPCPOPT_PRIDNS 129 /* RFC1877 */ - #define IPCPOPT_PRINBNS 130 /* RFC1877 */ - #define IPCPOPT_SECDNS 131 /* RFC1877 */ - #define IPCPOPT_SECNBNS 132 /* RFC1877 */ - -+struct tok ipcpopt_values[] = { -+ { IPCPOPT_2ADDR, "IP-Addrs" }, -+ { IPCPOPT_IPCOMP, "IP-Comp" }, -+ { IPCPOPT_ADDR, "IP-Addr" }, -+ { IPCPOPT_MOBILE4, "Home-Addr" }, -+ { IPCPOPT_PRIDNS, "Pri-DNS" }, -+ { IPCPOPT_PRINBNS, "Pri-NBNS" }, -+ { IPCPOPT_SECDNS, "Sec-DNS" }, -+ { IPCPOPT_SECNBNS, "Sec-NBNS" }, -+ { 0, NULL } -+}; -+ -+ -+/* IP6CP Config Options */ -+#define IP6CP_IFID 1 -+ -+struct tok ip6cpopt_values[] = { -+ { IP6CP_IFID, "Interface-ID" }, -+ { 0, NULL } -+}; -+ - /* ATCP - to be supported */ - /* OSINLCP - to be supported */ - /* BVCP - to be supported */ -@@ -366,6 +385,7 @@ - static void handle_bap (const u_char *p, int length); - static int print_lcp_config_options (const u_char *p, int); - static int print_ipcp_config_options (const u_char *p, int); -+static int print_ip6cp_config_options (const u_char *p, int); - static int print_ccp_config_options (const u_char *p, int); - static int print_bacp_config_options (const u_char *p, int); - static void handle_ppp (u_int proto, const u_char *p, int length); -@@ -382,7 +402,7 @@ - - tptr=pptr; - -- typestr = tok2str(ppptype2str, "unknown", proto); -+ typestr = tok2str(ppptype2str, "unknown ctrl-proto (0x%04x)", proto); - printf("%s, ",typestr); - - if (length < 4) /* FIXME weak boundary checking */ -@@ -401,7 +421,7 @@ - tptr += 2; - - if (length <= 4) -- return; /* there may be a NULL confreq etc. */ -+ goto print_len_and_return; /* there may be a NULL confreq etc. */ - - switch (code) { - case CPCODES_VEXT: -@@ -427,6 +447,9 @@ - case PPP_IPCP: - pfunc = print_ipcp_config_options; - break; -+ case PPP_IPV6CP: -+ pfunc = print_ip6cp_config_options; -+ break; - case PPP_CCP: - pfunc = print_ccp_config_options; - break; -@@ -492,6 +515,8 @@ - print_unknown_data(pptr-2,"\n\t",length+2); - break; - } -+ -+ print_len_and_return: - printf(", length %u", length); - - if (vflag >1) -@@ -902,61 +927,41 @@ - opt = p[0]; - if (length < len) - return 0; -+ -+ printf(", %s (0x%02x) ", -+ tok2str(ipcpopt_values,"unknown",opt), -+ opt); -+ - switch (opt) { - case IPCPOPT_2ADDR: /* deprecated */ - if (len != 10) - goto invlen; - TCHECK2(*(p + 6), 4); -- printf(", IP-Addrs src %s, dst %s", -+ printf("src %s, dst %s", - ipaddr_string(p + 2), - ipaddr_string(p + 6)); - break; - case IPCPOPT_IPCOMP: - if (len < 4) - goto invlen; -- printf(", IP-Comp"); - TCHECK2(*(p + 2), 2); - if (EXTRACT_16BITS(p + 2) == PPP_VJC) { -- printf(" VJ-Comp"); -+ printf("VJ-Comp"); - /* XXX: VJ-Comp parameters should be decoded */ - } else -- printf(" unknown-comp-proto=%04x", EXTRACT_16BITS(p + 2)); -- break; -- case IPCPOPT_ADDR: -- if (len != 6) -- goto invlen; -- TCHECK2(*(p + 2), 4); -- printf(", IP-Addr %s", ipaddr_string(p + 2)); -+ printf("unknown-comp-proto %04x", EXTRACT_16BITS(p + 2)); - break; -+ -+ case IPCPOPT_ADDR: /* those options share the same format - fall through */ - case IPCPOPT_MOBILE4: -- if (len != 6) -- goto invlen; -- TCHECK2(*(p + 2), 4); -- printf(", Home-Addr %s", ipaddr_string(p + 2)); -- break; - case IPCPOPT_PRIDNS: -- if (len != 6) -- goto invlen; -- TCHECK2(*(p + 2), 4); -- printf(", Pri-DNS %s", ipaddr_string(p + 2)); -- break; - case IPCPOPT_PRINBNS: -- if (len != 6) -- goto invlen; -- TCHECK2(*(p + 2), 4); -- printf(", Pri-NBNS %s", ipaddr_string(p + 2)); -- break; - case IPCPOPT_SECDNS: -- if (len != 6) -- goto invlen; -- TCHECK2(*(p + 2), 4); -- printf(", Sec-DNS %s", ipaddr_string(p + 2)); -- break; - case IPCPOPT_SECNBNS: - if (len != 6) - goto invlen; - TCHECK2(*(p + 2), 4); -- printf(", Sec-NBNS %s", ipaddr_string(p + 2)); -+ printf("%s", ipaddr_string(p + 2)); - break; - default: - printf(", unknown-%d", opt); -@@ -972,6 +977,51 @@ - printf("[|ipcp]"); - return 0; - } -+ -+/* IP6CP config options */ -+static int -+print_ip6cp_config_options(const u_char *p, int length) -+{ -+ int len, opt; -+ -+ if (length < 2) -+ return 0; -+ TCHECK2(*p, 2); -+ len = p[1]; -+ opt = p[0]; -+ if (length < len) -+ return 0; -+ -+ printf(", %s (0x%02x) ", -+ tok2str(ip6cpopt_values,"unknown",opt), -+ opt); -+ -+ switch (opt) { -+ case IP6CP_IFID: -+ if (len != 10) -+ goto invlen; -+ TCHECK2(*(p + 2), 8); -+ printf("%04x:%04x:%04x:%04x", -+ EXTRACT_16BITS(p + 2), -+ EXTRACT_16BITS(p + 4), -+ EXTRACT_16BITS(p + 6), -+ EXTRACT_16BITS(p + 8)); -+ break; -+ default: -+ printf(", unknown-%d", opt); -+ break; -+ } -+ return len; -+ -+invlen: -+ printf(", invalid-length-%d", opt); -+ return 0; -+ -+trunc: -+ printf("[|ip6cp]"); -+ return 0; -+} -+ - - /* CCP config options */ - static int |