update tcptraceroute to 1.5beta, fixes PR ports/5462, from Stuart Henderson

ok aanriot@, naddy@
This commit is contained in:
rui 2007-05-26 22:06:19 +00:00
parent 8bc80ab8a4
commit cd8c5e4de2
14 changed files with 188 additions and 78 deletions

View File

@ -1,9 +1,8 @@
# $OpenBSD: Makefile,v 1.11 2005/05/24 00:10:44 mjc Exp $
# $OpenBSD: Makefile,v 1.12 2007/05/26 22:06:19 rui Exp $
COMMENT= "traceroute implementation using TCP packets"
DISTNAME= tcptraceroute-1.4
PKGNAME= ${DISTNAME}p1
DISTNAME= tcptraceroute-1.5beta7
CATEGORIES= net
HOMEPAGE= http://michael.toren.net/code/tcptraceroute/
@ -17,21 +16,18 @@ PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
WANTLIB= c pcap
CONFIGURE_STYLE= gnu
CONFIGURE_ARGS= --with-libnet=${PREFIX} \
--enable-noselect-default
MASTER_SITES= http://michael.toren.net/code/tcptraceroute/
LIB_DEPENDS= lib/libnet-1.0/net.=0:libnet-1.0*:net/libnet/1.0
LIB_DEPENDS= lib/libnet-1.1/net.=11:libnet-1.1*:net/libnet/1.1
MAKE_FLAGS= CC="${CC}" \
CFLAGS="${CFLAGS}"
ALL_TARGET=
NO_REGRESS= Yes
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/tcptraceroute ${PREFIX}/sbin
${INSTALL_DATA} ${WRKSRC}/tcptraceroute.8 ${PREFIX}/man/man8
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/tcptraceroute
${INSTALL_DATA} ${WRKSRC}/examples.txt ${PREFIX}/share/examples/tcptraceroute
USE_GMAKE= Yes
.include <bsd.port.mk>

View File

@ -1,5 +1,5 @@
MD5 (tcptraceroute-1.4.tar.gz) = NcXn2WDysHPbAQngAE4TTg==
RMD160 (tcptraceroute-1.4.tar.gz) = Zyg1XKlxs+ZI6VcE50gmy8OPqU8=
SHA1 (tcptraceroute-1.4.tar.gz) = Hb2aChCxFpWwIEvqRgRjqd2SEzg=
SHA256 (tcptraceroute-1.4.tar.gz) = HvbEc2tV9H06K7JrmZy7QJlToRL2N7y+xBBtoqCTe94=
SIZE (tcptraceroute-1.4.tar.gz) = 31918
MD5 (tcptraceroute-1.5beta7.tar.gz) = ZdEAFQn5ceqYb8vC3QCWQw==
RMD160 (tcptraceroute-1.5beta7.tar.gz) = /pNzQfTvGqNYslPDr0kEGaaJAx8=
SHA1 (tcptraceroute-1.5beta7.tar.gz) = eIR+9LpwMc7mYMVAWTJW/ThKGmI=
SHA256 (tcptraceroute-1.5beta7.tar.gz) = rtWxY+1IhvBCQrRgBabLSHbvOK1yABqU+stiqZ3JnFc=
SIZE (tcptraceroute-1.5beta7.tar.gz) = 119119

View File

@ -1,16 +0,0 @@
$OpenBSD: patch-Makefile,v 1.3 2005/05/24 00:11:51 mjc Exp $
--- Makefile.orig Sun May 19 18:11:38 2002
+++ Makefile Sun May 22 13:43:22 2005
@@ -8,9 +8,10 @@ CFLAGS = -O2 -Wall
DESTDIR=/usr/local/bin
tcptraceroute: tcptraceroute.c
- $(CC) $(CFLAGS) `libnet-config --defines` \
+ $(CC) $(CFLAGS) `libnet-config-1.0 --cflags` \
+ `libnet-config-1.0 --defines` \
-o tcptraceroute tcptraceroute.c \
- `libnet-config --libs` -lpcap
+ `libnet-config-1.0 --libs` -lpcap
static:
$(MAKE) tcptraceroute CFLAGS="$(CFLAGS) -static"

View File

@ -0,0 +1,24 @@
$OpenBSD: patch-configure,v 1.1 2007/05/26 22:06:19 rui Exp $
--- configure.orig Wed Mar 29 02:49:55 2006
+++ configure Sun Apr 29 15:11:06 2007
@@ -3713,7 +3713,7 @@ echo "$as_me: using libpcap in $withval" >&6;}
fi;
-LIBNET_CONFIG="libnet-config" # relative, using $PATH
+LIBNET_CONFIG="libnet-config-1.1" # relative, using $PATH
# Check whether --with-libnet or --without-libnet was given.
if test "${with_libnet+set}" = set; then
@@ -3727,9 +3727,11 @@ if test "${with_libnet+set}" = set; then
test -f "$withval/libnet.h" && LIBNETCC="$LIBNETCC -I$withval"
test -f "$withval/include/libnet.h" && LIBNETCC="$LIBNETCC -I$withval/include"
+ test -f "$withval/include/libnet-1.1/libnet.h" && LIBNETCC="$LIBNETCC -I$withval/include/libnet-1.1"
test -f "$withval/libnet.a" && LIBNETLD="$LIBNETLD -L$withval"
test -f "$withval/lib/libnet.a" && LIBNETLD="$LIBNETLD -L$withval/lib"
+ test -f "$withval/lib/libnet-1.1/libnet.a" && LIBNETLD="$LIBNETLD -L$withval/lib/libnet-1.1"
if test -z "$LIBNETCC" -o -z "$LIBNETLD"
then

View File

@ -0,0 +1,30 @@
$OpenBSD: patch-datalink_c,v 1.1 2007/05/26 22:06:19 rui Exp $
--- datalink.c.orig Sun Apr 29 11:49:51 2007
+++ datalink.c Sun Apr 29 11:49:54 2007
@@ -137,7 +137,7 @@ void getinterfaces(void)
struct ifconf ifc;
struct ifreq *ifrp, ifr;
int numreqs, i, s;
- u_long addr;
+ u_int32_t addr;
int salen;
char *x;
@@ -278,7 +278,7 @@ void getinterfaces(void)
* given destination address.
*/
-u_long findsrc(u_long dest)
+u_int32_t findsrc(u_int32_t dest)
{
struct sockaddr_in sinsrc, sindest;
int s, size;
@@ -314,7 +314,7 @@ u_long findsrc(u_long dest)
* interface exists with an address of 127.0.0.1.
*/
-char *finddev(u_long with_src)
+char *finddev(u_int32_t with_src)
{
struct interface_entry *p;
char *device = NULL;

View File

@ -0,0 +1,19 @@
$OpenBSD: patch-datalink_h,v 1.1 2007/05/26 22:06:19 rui Exp $
--- datalink.h.orig Sun Apr 29 11:49:51 2007
+++ datalink.h Sun Apr 29 11:49:54 2007
@@ -29,12 +29,12 @@ extern struct datalinktype {
/* interface linked list, built by getinterfaces() */
extern struct interface_entry {
char *name;
- u_long addr;
+ u_int32_t addr;
struct interface_entry *next;
} *interfaces;
int datalinkoffset(int);
char *datalinkname(int);
void getinterfaces(void);
-u_long findsrc(u_long);
-char *finddev(u_long);
+u_int32_t findsrc(u_int32_t);
+char *finddev(u_int32_t);

View File

@ -0,0 +1,21 @@
$OpenBSD: patch-main_c,v 1.1 2007/05/26 22:06:19 rui Exp $
--- main.c.orig Sun Apr 29 11:49:51 2007
+++ main.c Sun Apr 29 11:49:54 2007
@@ -23,7 +23,7 @@
#include "tcptraceroute.h"
/* globals */
-u_long dst_ip, src_ip, isn;
+u_int32_t dst_ip, src_ip, isn;
u_short src_prt, dst_prt;
char *device, *name, *dst, *src;
char dst_name[TEXTSIZE], dst_prt_name[TEXTSIZE], filter[TEXTSIZE];
@@ -43,7 +43,7 @@ char errbuf [PCAP_ERRBUF_SIZE > LIBNET_ERRBUF_SIZE ?
void defaults(void)
{
struct servent *serv;
- u_long recommended_src;
+ u_int32_t recommended_src;
getinterfaces();

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-probe_c,v 1.1 2007/05/26 22:06:19 rui Exp $
--- probe.c.orig Sun Apr 29 11:49:51 2007
+++ probe.c Sun Apr 29 11:49:54 2007
@@ -297,7 +297,7 @@ void showprobe(proberecord *record)
/* Variables to keep state between calls */
static char laststate[TEXTSIZE];
static int lastttl;
- static u_long lastaddr, lastdnat_ip;
+ static u_int32_t lastaddr, lastdnat_ip;
static u_short lastdnat_dport;
static int everprinthost; // have we ever printed the hostname?

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-probe_h,v 1.1 2007/05/26 22:06:19 rui Exp $
--- probe.h.orig Sun Apr 29 11:49:51 2007
+++ probe.h Sun Apr 29 11:49:54 2007
@@ -43,7 +43,7 @@ typedef struct {
u_short id, src_prt, dnat_dport;
struct timeval timestamp;
double delta;
- u_long addr, dnat_ip;
+ u_int32_t addr, dnat_ip;
char *state;
char *string;
} proberecord;

View File

@ -1,40 +0,0 @@
$OpenBSD: patch-tcptraceroute_c,v 1.4 2004/03/23 19:22:02 pvalchev Exp $
--- tcptraceroute.c.orig 2002-07-30 14:51:05.000000000 -0700
+++ tcptraceroute.c 2004-03-13 09:41:15.000000000 -0800
@@ -391,10 +391,10 @@ void pfatal(char *err)
void usage(void)
{
printf("\n%s\n%s\n", VERSION, BANNER);
- fatal("Usage: %s [-nNFSAE] [-i <interface>] [-f <first ttl>]
- [-l <packet length>] [-q <number of queries>] [-t <tos>]
- [-m <max ttl>] [-pP] <source port>] [-s <source address>]
- [-w <wait time>] <host> [destination port] [packet length]\n\n", name);
+ fatal("Usage: %s [-nNFSAE] [-i <interface>] [-f <first ttl>]\n"
+" [-l <packet length>] [-q <number of queries>] [-t <tos>]\n"
+" [-m <max ttl>] [-pP] <source port>] [-s <source address>]\n"
+" [-w <wait time>] <host> [destination port] [packet length]\n\n", name);
}
void about(void)
@@ -1182,9 +1182,9 @@ void initcapture(void)
if (! (pcap = pcap_open_live(device, offset + SNAPLEN, 0, 10, errbuf)))
fatal("pcap_open_live failed: %s", errbuf);
- safe_snprintf(filter, TEXTSIZE, "
- (tcp and src host %s and src port %d and dst host %s)
- or ((icmp[0] == 11 or icmp[0] == 3) and dst host %s)",
+ safe_snprintf(filter, TEXTSIZE, "\n"
+" (tcp and src host %s and src port %d and dst host %s)\n"
+" or ((icmp[0] == 11 or icmp[0] == 3) and dst host %s)",
iptos(dst_ip), dst_prt, iptos(src_ip), iptos(src_ip));
if (o_nofilter)
@@ -1386,7 +1386,7 @@ int capture(proberecord *record)
FD_ZERO(&sfd);
FD_SET(pcap_fd, &sfd);
- ret = o_noselect ? 1 : select(pcap_fd + 1, &sfd, NULL, NULL, &timeleft);
+ ret = 1;
if (ret < 0)
{

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-tcptraceroute_h,v 1.1 2007/05/26 22:06:19 rui Exp $
--- tcptraceroute.h.orig Sun Apr 29 11:49:51 2007
+++ tcptraceroute.h Sun Apr 29 11:49:54 2007
@@ -76,7 +76,7 @@ Updates are available from http://michael.toren.net/co
#include "probe.h"
#include "capture.h"
-extern u_long dst_ip, src_ip, isn;
+extern u_int32_t dst_ip, src_ip, isn;
extern u_short src_prt, dst_prt;
extern char *device, *name, *dst, *src;
extern char dst_name[], dst_prt_name[], filter[], errbuf[];

View File

@ -0,0 +1,21 @@
$OpenBSD: patch-util_c,v 1.1 2007/05/26 22:06:19 rui Exp $
--- util.c.orig Sun Apr 29 11:49:51 2007
+++ util.c Sun Apr 29 11:49:54 2007
@@ -219,7 +219,7 @@ int tvsign(struct timeval *tv)
* I was debugging. I really could get by with only 2 now, but *shrug*.
*/
-char *iptos(u_long in)
+char *iptos(u_int32_t in)
{
static char output[IPTOSBUFFERS][IPTOSBUFSIZ];
static short which;
@@ -236,7 +236,7 @@ char *iptos(u_long in)
* RFC1918 space.
*/
-char *iptohost(u_long in)
+char *iptohost(u_int32_t in)
{
u_char *p = (u_char *)&in;

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-util_h,v 1.1 2007/05/26 22:06:19 rui Exp $
--- util.h.orig Sun Apr 29 11:49:51 2007
+++ util.h Sun Apr 29 11:49:54 2007
@@ -50,6 +50,6 @@ char *sprintable(char *);
int isnumeric(char *);
struct timeval tvdiff(struct timeval *, struct timeval *);
int tvsign(struct timeval *);
-char *iptos(u_long);
-char *iptohost(u_long);
+char *iptos(u_int32_t);
+char *iptohost(u_int32_t);
void debugoptions(void);

View File

@ -1,5 +1,12 @@
@comment $OpenBSD: PLIST,v 1.4 2004/09/15 18:17:46 espie Exp $
@man man/man8/tcptraceroute.8
sbin/tcptraceroute
share/examples/tcptraceroute/
share/examples/tcptraceroute/examples.txt
@comment $OpenBSD: PLIST,v 1.5 2007/05/26 22:06:19 rui Exp $
bin/tcptraceroute
@man man/man1/tcptraceroute.1
share/doc/tcptraceroute/
@comment share/doc/tcptraceroute/AUTHORS
@comment share/doc/tcptraceroute/COPYING
@comment share/doc/tcptraceroute/ChangeLog
@comment share/doc/tcptraceroute/NEWS
@comment share/doc/tcptraceroute/README
share/doc/tcptraceroute/examples.txt
share/doc/tcptraceroute/tcptraceroute.1.html
share/doc/tcptraceroute/tcptraceroute.lsm