diff options
author | Marcelo Góes <vanquirius@gentoo.org> | 2006-03-09 18:07:30 +0000 |
---|---|---|
committer | Marcelo Góes <vanquirius@gentoo.org> | 2006-03-09 18:07:30 +0000 |
commit | aba4e1d4ed1f29cc21ea0df785b88b502375577c (patch) | |
tree | a2b9f4dce006870a7bf3b3d6410e1fce8969cc23 /net-analyzer | |
parent | Add -Os-fix to all ebuilds, remove old 0.4.3-r4 (diff) | |
download | gentoo-2-aba4e1d4ed1f29cc21ea0df785b88b502375577c.tar.gz gentoo-2-aba4e1d4ed1f29cc21ea0df785b88b502375577c.tar.bz2 gentoo-2-aba4e1d4ed1f29cc21ea0df785b88b502375577c.zip |
Add patch from Fedora's cvs to add support for ICMP extensions. Fixes bug 125604. Thanks to Thorsten Fischer <thorsten at irmplc dot com>.
(Portage version: 2.0.54 vanquished edition)
Diffstat (limited to 'net-analyzer')
-rw-r--r-- | net-analyzer/traceroute/ChangeLog | 10 | ||||
-rw-r--r-- | net-analyzer/traceroute/Manifest | 15 | ||||
-rw-r--r-- | net-analyzer/traceroute/files/digest-traceroute-1.4_p12-r4 | 2 | ||||
-rw-r--r-- | net-analyzer/traceroute/files/traceroute-1.4a12-mpls-icmp-02.patch | 194 | ||||
-rw-r--r-- | net-analyzer/traceroute/traceroute-1.4_p12-r4.ebuild | 54 |
5 files changed, 262 insertions, 13 deletions
diff --git a/net-analyzer/traceroute/ChangeLog b/net-analyzer/traceroute/ChangeLog index 9088c0057515..e8c42539865b 100644 --- a/net-analyzer/traceroute/ChangeLog +++ b/net-analyzer/traceroute/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for net-analyzer/traceroute # Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/traceroute/ChangeLog,v 1.27 2006/03/01 02:01:44 vanquirius Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/traceroute/ChangeLog,v 1.28 2006/03/09 18:07:30 vanquirius Exp $ + +*traceroute-1.4_p12-r4 (09 Mar 2006) + + 09 Mar 2006; Marcelo Goes <vanquirius@gentoo.org> + +files/traceroute-1.4a12-mpls-icmp-02.patch, + +traceroute-1.4_p12-r4.ebuild: + Add patch from Fedora's cvs to add support for ICMP extensions. Fixes bug + 125604. Thanks to Thorsten Fischer <thorsten at irmplc dot com>. 01 Mar 2006; Marcelo Goes <vanquirius@gentoo.org> -files/traceroute-1.4-emptylabel.patch, diff --git a/net-analyzer/traceroute/Manifest b/net-analyzer/traceroute/Manifest index b5220572eeef..d8c91edb6310 100644 --- a/net-analyzer/traceroute/Manifest +++ b/net-analyzer/traceroute/Manifest @@ -1,18 +1,9 @@ MD5 9adb30ccf9defad3c30ae689bcbe077c ChangeLog 4799 -RMD160 49e48bf5275234be1939ce69f9c18e64b2bbdb82 ChangeLog 4799 -SHA256 e811de5bfcb4281f8481ececda9b61ef31cae408c806f3662cf1c1ec174a304a ChangeLog 4799 MD5 8122082980a7ee66b278371da18b5c61 files/digest-traceroute-1.4_p12-r2 521 -RMD160 347245db1ccc102e599090e0592efeaaba1bf41c files/digest-traceroute-1.4_p12-r2 521 -SHA256 8013b2342e32d798ab799788e833eefdb58dab81d5fdf56c465599c7296669f4 files/digest-traceroute-1.4_p12-r2 521 MD5 8122082980a7ee66b278371da18b5c61 files/digest-traceroute-1.4_p12-r3 521 -RMD160 347245db1ccc102e599090e0592efeaaba1bf41c files/digest-traceroute-1.4_p12-r3 521 -SHA256 8013b2342e32d798ab799788e833eefdb58dab81d5fdf56c465599c7296669f4 files/digest-traceroute-1.4_p12-r3 521 +MD5 3eae5594aebda2c1d7d981fc74fea997 files/digest-traceroute-1.4_p12-r4 143 +MD5 2504b277ffc8b8a3730629607672663d files/traceroute-1.4a12-mpls-icmp-02.patch 4273 MD5 7ed4ef8e3d3fd7d4c7e9682b2519d739 metadata.xml 235 -RMD160 de3c26bbe3899e398acc788b01189adf8487038e metadata.xml 235 -SHA256 0dd7765ffffa47a13dd4ffcd8f83d0b1f7cb64a0b80abe132ecaf0373bf6d11e metadata.xml 235 MD5 0733378af785c65743ff4d85bac2060d traceroute-1.4_p12-r2.ebuild 1309 -RMD160 694917ebaf4b684615855750491030479662aa38 traceroute-1.4_p12-r2.ebuild 1309 -SHA256 d3be956c3dd74330d701506c1d01917ceaa9b6efa52d4b0dd72825d3e7686ea3 traceroute-1.4_p12-r2.ebuild 1309 MD5 47deceb3075f95da7921ebc8cbd08360 traceroute-1.4_p12-r3.ebuild 1588 -RMD160 79e4b416dff8d687c88d8e1ee76c6a9a68b7583e traceroute-1.4_p12-r3.ebuild 1588 -SHA256 d1ab8210236999d329267b9a71e360719ec551ab4ac89bdd66c442cfad10d154 traceroute-1.4_p12-r3.ebuild 1588 +MD5 1b9374beb124588dc1e4732accff521e traceroute-1.4_p12-r4.ebuild 1647 diff --git a/net-analyzer/traceroute/files/digest-traceroute-1.4_p12-r4 b/net-analyzer/traceroute/files/digest-traceroute-1.4_p12-r4 new file mode 100644 index 000000000000..66ab86c8d2a0 --- /dev/null +++ b/net-analyzer/traceroute/files/digest-traceroute-1.4_p12-r4 @@ -0,0 +1,2 @@ +MD5 0b3b77a7a4b6338c4e1ee2ca338d1529 traceroute-1.4-genpatches.tar.gz 6554 +MD5 964d599ef696efccdeebe7721cd4828d traceroute-1.4a12.tar.gz 74917 diff --git a/net-analyzer/traceroute/files/traceroute-1.4a12-mpls-icmp-02.patch b/net-analyzer/traceroute/files/traceroute-1.4a12-mpls-icmp-02.patch new file mode 100644 index 000000000000..d61346a957be --- /dev/null +++ b/net-analyzer/traceroute/files/traceroute-1.4a12-mpls-icmp-02.patch @@ -0,0 +1,194 @@ +--- traceroute-1.4a12/traceroute.c Thu Dec 14 08:04:50 2000 ++++ traceroute/traceroute.c Sun Aug 17 21:21:07 2003 +@@ -282,6 +282,55 @@ + }; + #endif + ++/* ++ * Support for ICMP extensions ++ * ++ * http://www.ietf.org/proceedings/01aug/I-D/draft-ietf-mpls-icmp-02.txt ++ */ ++#define ICMP_EXT_OFFSET 8 /* ICMP type, code, checksum, unused */ + \ ++ 128 /* original datagram */ ++#define ICMP_EXT_VERSION 2 ++/* ++ * ICMP extensions, common header ++ */ ++struct icmp_ext_cmn_hdr { ++#if BYTE_ORDER == BIG_ENDIAN ++ u_char version:4; ++ u_char reserved1:4; ++#else ++ u_char reserved1:4; ++ u_char version:4; ++#endif ++ u_char reserved2; ++ u_short checksum; ++}; ++ ++/* ++ * ICMP extensions, object header ++ */ ++struct icmp_ext_obj_hdr { ++ u_short length; ++ u_char class_num; ++#define MPLS_STACK_ENTRY_CLASS 1 ++ u_char c_type; ++#define MPLS_STACK_ENTRY_C_TYPE 1 ++}; ++ ++struct mpls_header { ++#if BYTE_ORDER == BIG_ENDIAN ++ u_int32_t label:20; ++ u_char exp:3; ++ u_char s:1; ++ u_char ttl:8; ++#else ++ u_char ttl:8; ++ u_char s:1; ++ u_char exp:3; ++ u_int32_t label:20; ++#endif ++}; ++ ++ + u_char packet[512]; /* last inbound (icmp) packet */ + + struct ip *outip; /* last output (udp) packet */ +@@ -348,6 +397,7 @@ + void tvsub(struct timeval *, struct timeval *); + __dead void usage(void); + int wait_for_reply(int, struct sockaddr_in *, const struct timeval *); ++void decode_extensions(u_char *buf, int ip_len); + #ifndef HAVE_USLEEP + int usleep(u_int); + #endif +@@ -876,6 +926,8 @@ + } + if (cc == 0) + Printf(" *"); ++ if (cc && probe == nprobes-1) ++ decode_extensions(packet, cc); + (void)fflush(stdout); + } + putchar('\n'); +@@ -884,6 +936,118 @@ + break; + } + exit(0); ++} ++ ++void ++decode_extensions(u_char *buf, int ip_len) ++{ ++ struct icmp_ext_cmn_hdr *cmn_hdr; ++ struct icmp_ext_obj_hdr *obj_hdr; ++ struct mpls_header *mpls; ++ int datalen, obj_len; ++ u_int32_t mpls_h; ++ struct ip *ip; ++ ++ ip = (struct ip *)buf; ++ ++ if (ip_len <= sizeof(struct ip) + ICMP_EXT_OFFSET) { ++ /* ++ * No support for ICMP extensions on this host ++ */ ++ return; ++ } ++ ++ /* ++ * Move forward to the start of the ICMP extensions, if present ++ */ ++ buf += (ip->ip_hl << 2) + ICMP_EXT_OFFSET; ++ cmn_hdr = (struct icmp_ext_cmn_hdr *)buf; ++ ++ if (cmn_hdr->version != ICMP_EXT_VERSION) { ++ /* ++ * Unknown version ++ */ ++ return; ++ } ++ ++ datalen = ip_len - ((u_char *)cmn_hdr - (u_char *)ip); ++ ++ /* ++ * Check the checksum, cmn_hdr->checksum == 0 means no checksum'ing ++ * done by sender. ++ * ++ * If the checksum is ok, we'll get 0, as the checksum is calculated ++ * with the checksum field being 0'd. ++ */ ++ if (ntohs(cmn_hdr->checksum) && ++ in_cksum((u_short *)cmn_hdr, datalen)) { ++ ++ return; ++ } ++ ++ buf += sizeof(*cmn_hdr); ++ datalen -= sizeof(*cmn_hdr); ++ ++ while (datalen > 0) { ++ obj_hdr = (struct icmp_ext_obj_hdr *)buf; ++ obj_len = ntohs(obj_hdr->length); ++ ++ /* ++ * Sanity check the length field ++ */ ++ if (obj_len > datalen) { ++ return; ++ } ++ ++ datalen -= obj_len; ++ ++ /* ++ * Move past the object header ++ */ ++ buf += sizeof(struct icmp_ext_obj_hdr); ++ obj_len -= sizeof(struct icmp_ext_obj_hdr); ++ ++ switch (obj_hdr->class_num) { ++ case MPLS_STACK_ENTRY_CLASS: ++ switch (obj_hdr->c_type) { ++ case MPLS_STACK_ENTRY_C_TYPE: ++ while (obj_len >= sizeof(u_int32_t)) { ++ mpls_h = ntohl(*(u_int32_t *)buf); ++ ++ buf += sizeof(u_int32_t); ++ obj_len -= sizeof(u_int32_t); ++ ++ mpls = (struct mpls_header *) &mpls_h; ++ printf("\n MPLS Label=%d CoS=%d TTL=%d S=%d", ++ mpls->label, mpls->exp, mpls->ttl, mpls->s); ++ } ++ if (obj_len > 0) { ++ /* ++ * Something went wrong, and we're at a unknown offset ++ * into the packet, ditch the rest of it. ++ */ ++ return; ++ } ++ break; ++ default: ++ /* ++ * Unknown object, skip past it ++ */ ++ buf += ntohs(obj_hdr->length) - ++ sizeof(struct icmp_ext_obj_hdr); ++ break; ++ } ++ break; ++ ++ default: ++ /* ++ * Unknown object, skip past it ++ */ ++ buf += ntohs(obj_hdr->length) - ++ sizeof(struct icmp_ext_obj_hdr); ++ break; ++ } ++ } + } + + int diff --git a/net-analyzer/traceroute/traceroute-1.4_p12-r4.ebuild b/net-analyzer/traceroute/traceroute-1.4_p12-r4.ebuild new file mode 100644 index 000000000000..8e1aac44a66a --- /dev/null +++ b/net-analyzer/traceroute/traceroute-1.4_p12-r4.ebuild @@ -0,0 +1,54 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/traceroute/traceroute-1.4_p12-r4.ebuild,v 1.1 2006/03/09 18:07:30 vanquirius Exp $ + +inherit eutils flag-o-matic + +MY_P="${PN}-${PV/_p/a}" +DESCRIPTION="Utility to trace the route of IP packets" +HOMEPAGE="http://ee.lbl.gov/" +SRC_URI="ftp://ee.lbl.gov/${MY_P}.tar.gz + mirror://gentoo/${PN}-1.4-genpatches.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" +IUSE="static" + +DEPEND="" + +S="${WORKDIR}/${MY_P}" + +src_unpack() { + unpack ${A} + cd "${S}" + + # nasty hack until bug 93363 is fixed + chmod 644 config.{guess,sub} + + epatch "${WORKDIR}"/traceroute-1.4-target-resolv.patch + epatch "${WORKDIR}"/traceroute-1.4a12-LDFLAGS.patch + epatch "${WORKDIR}"/traceroute-1.4a5-bigpacklen.patch + epatch "${WORKDIR}"/traceroute-1.4a12.patch + epatch "${WORKDIR}"/traceroute-1.4a5-droproot.patch + epatch "${WORKDIR}"/traceroute-1.4a5-llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch.patch + epatch "${WORKDIR}"/traceroute-1.4a5-secfix.patch + epatch "${WORKDIR}"/traceroute-1.4a5-unaligned.patch + epatch "${WORKDIR}"/traceroute-1.4-emptylabel.patch + epatch "${FILESDIR}"/traceroute-1.4a12-mpls-icmp-02.patch + + # assume linux by default #26699 + sed -i '/^t=/s:generic:linux:' configure + + use static && append-ldflags -static + append-ldflags $(bindnow-flags) -Wl,-z,relro +} + +src_install() { + dosbin traceroute || die "dosbin" + fowners root:wheel /usr/sbin/traceroute + fperms 4711 /usr/sbin/traceroute + + doman traceroute.8 + dodoc CHANGES +} |