head 1.9; access; symbols pkgsrc-2013Q2:1.9.0.34 pkgsrc-2013Q2-base:1.9 pkgsrc-2012Q4:1.9.0.32 pkgsrc-2012Q4-base:1.9 pkgsrc-2011Q4:1.9.0.30 pkgsrc-2011Q4-base:1.9 pkgsrc-2011Q2:1.9.0.28 pkgsrc-2011Q2-base:1.9 pkgsrc-2009Q4:1.9.0.26 pkgsrc-2009Q4-base:1.9 pkgsrc-2008Q4:1.9.0.24 pkgsrc-2008Q4-base:1.9 pkgsrc-2008Q3:1.9.0.22 pkgsrc-2008Q3-base:1.9 cube-native-xorg:1.9.0.20 cube-native-xorg-base:1.9 pkgsrc-2008Q2:1.9.0.18 pkgsrc-2008Q2-base:1.9 pkgsrc-2008Q1:1.9.0.16 pkgsrc-2008Q1-base:1.9 pkgsrc-2007Q4:1.9.0.14 pkgsrc-2007Q4-base:1.9 pkgsrc-2007Q3:1.9.0.12 pkgsrc-2007Q3-base:1.9 pkgsrc-2007Q2:1.9.0.10 pkgsrc-2007Q2-base:1.9 pkgsrc-2007Q1:1.9.0.8 pkgsrc-2007Q1-base:1.9 pkgsrc-2006Q4:1.9.0.6 pkgsrc-2006Q4-base:1.9 pkgsrc-2006Q3:1.9.0.4 pkgsrc-2006Q3-base:1.9 pkgsrc-2006Q2:1.9.0.2 pkgsrc-2006Q2-base:1.9 pkgsrc-2006Q1:1.8.0.2 pkgsrc-2006Q1-base:1.8 pkgsrc-2005Q4:1.7.0.8 pkgsrc-2005Q4-base:1.7 pkgsrc-2005Q3:1.7.0.6 pkgsrc-2005Q3-base:1.7 pkgsrc-2005Q2:1.7.0.4 pkgsrc-2005Q2-base:1.7 pkgsrc-2005Q1:1.7.0.2 pkgsrc-2005Q1-base:1.7 pkgsrc-2004Q4:1.5.0.2 pkgsrc-2004Q4-base:1.5 pkgsrc-2004Q3:1.4.0.10 pkgsrc-2004Q3-base:1.4 pkgsrc-2004Q2:1.4.0.8 pkgsrc-2004Q2-base:1.4 pkgsrc-2004Q1:1.4.0.6 pkgsrc-2004Q1-base:1.4 pkgsrc-2003Q4:1.4.0.4 pkgsrc-2003Q4-base:1.4 netbsd-1-6-1:1.4.0.2 netbsd-1-6-1-base:1.4 netbsd-1-6:1.3.0.8 netbsd-1-6-RELEASE-base:1.3 pkgviews:1.3.0.4 pkgviews-base:1.3 buildlink2:1.3.0.2 buildlink2-base:1.3 netbsd-1-5-PATCH003:1.3 pkgsrc-base:1.1.1.1 TNF:1.1.1; locks; strict; comment @# @; 1.9 date 2006.04.03.18.38.58; author wiz; state dead; branches; next 1.8; 1.8 date 2006.03.22.23.56.38; author joerg; state Exp; branches; next 1.7; 1.7 date 2005.02.27.22.49.43; author wiz; state Exp; branches; next 1.6; 1.6 date 2005.02.01.17.02.00; author wiz; state Exp; branches; next 1.5; 1.5 date 2004.10.27.16.18.31; author wiz; state Exp; branches; next 1.4; 1.4 date 2003.01.09.16.36.06; author mycroft; state Exp; branches; next 1.3; 1.3 date 2002.03.13.02.16.13; author wiz; state Exp; branches; next 1.2; 1.2 date 2001.11.04.14.09.32; author wiz; state Exp; branches; next 1.1; 1.1 date 2001.10.16.15.11.00; author agc; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2001.10.16.15.11.00; author agc; state Exp; branches; next ; desc @@ 1.9 log @Update mtr to 0.71: 0.71: The build-time check for the resolver library was improved. Binding to a specific interface was fixed. Incorrect display of multiple routes was fixed. Several minor bugs were fixed. v0.70 Antinio submitted a cumulative patch containing some nice improvements. He also submitted an automake patch that causes mtr to no longer compile on my system. I refuse to have mtr "in the dark" that I can't test-compile the dist. Add option for gtk support, and remove mtr-gtk package. @ text @$NetBSD: patch-ab,v 1.8 2006/03/22 23:56:38 joerg Exp $ --- dns.c.orig 2005-01-11 08:32:42.000000000 +0000 +++ dns.c @@@@ -28,13 +28,20 @@@@ #include #include #include -#include #include #include #include +#ifdef __APPLE__ +#include +#else #include +#endif #include +#ifdef __APPLE__ +#include +#else #include +#endif #include #include #include @@@@ -54,9 +61,6 @@@@ extern char *sys_errlist[]; #define strerror(errno) (((errno) >= 0 && (errno) < sys_nerr) ? sys_errlist[errno] : "unlisted error") #endif -/* Hmm, it seems Irix requires this */ -extern int errno; - extern int af; /* Defines */ @@@@ -294,6 +298,17 @@@@ char nullstring[] = ""; int use_dns = 1; +#ifdef res_ninit +#define RES_INIT() res_ninit(&myres); +#define RES_MKQUERY(a, b, c, d, e, f, g, h, i) \ + res_nmkquery(&myres, a, b, c, d, e, f, g, h, i) +struct __res_state myres; +#else +#define RES_INIT() res_init(); +#define RES_MKQUERY(a, b, c, d, e, f, g, h, i) \ + res_mkquery(a, b, c, d, e, f, g, h, i) +#define myres _res +#endif /* Code */ #ifdef CorruptCheck @@@@ -468,14 +483,14 @@@@ void dns_open(void) { int option,i; - res_init(); - if (!_res.nscount) { + RES_INIT(); + if (!myres.nscount) { fprintf(stderr,"No nameservers defined.\n"); exit(-1); } - _res.options|= RES_RECURSE | RES_DEFNAMES | RES_DNSRCH; - for (i = 0;i < _res.nscount;i++) - _res.nsaddr_list[i].sin_family = AF_INET; + myres.options|= RES_RECURSE | RES_DEFNAMES | RES_DNSRCH; + for (i = 0;i < myres.nscount;i++) + myres.nsaddr_list[i].sin_family = AF_INET; resfd = socket(AF_INET, SOCK_DGRAM, 0); if (resfd == -1) { fprintf(stderr,"Unable to allocate socket for nameserver communication: %s\n", @@@@ -858,17 +873,17 @@@@ void dorequest(char *s,int type,word id) { packetheader *hp; int r,i; - int buf[(MaxPacketsize/sizeof (int))+1]; + unsigned char buf[MaxPacketsize]; - r = res_mkquery(QUERY,s,C_IN,type,NULL,0,NULL,(unsigned char*)buf,MaxPacketsize); + r = RES_MKQUERY(QUERY,s,C_IN,type,NULL,0,NULL,(unsigned char*)buf,MaxPacketsize); if (r == -1) { restell("Resolver error: Query too large."); return; } hp = (packetheader *)buf; hp->id = id; /* htons() deliberately left out (redundant) */ - for (i = 0;i < _res.nscount;i++) - (void)sendto(resfd,buf,r,0,(struct sockaddr *)&_res.nsaddr_list[i], + for (i = 0;i < myres.nscount;i++) + (void)sendto(resfd,buf,r,0,(struct sockaddr *)&myres.nsaddr_list[i], sizeof(struct sockaddr)); } @@@@ -1224,18 +1239,18 @@@@ void dns_ack(void) /* Check to see if this server is actually one we sent to */ if ( addrcmp( (void *) &(from4->sin_addr), (void *) &localhost, (int) AF_INET ) == 0 ) { - for (i = 0;i < _res.nscount;i++) - if ( addrcmp( (void *) &(_res.nsaddr_list[i].sin_addr), + for (i = 0;i < myres.nscount;i++) + if ( addrcmp( (void *) &(myres.nsaddr_list[i].sin_addr), (void *) &(from4->sin_addr), (int) AF_INET ) == 0 || - addrcmp( (void *) &(_res.nsaddr_list[i].sin_addr), + addrcmp( (void *) &(myres.nsaddr_list[i].sin_addr), (void *) &unspec_addr, (int) AF_INET ) != 0 ) /* 0.0.0.0 replies as 127.0.0.1 */ break; } else - for (i = 0;i < _res.nscount;i++) - if ( addrcmp( (void *) &(_res.nsaddr_list[i].sin_addr), + for (i = 0;i < myres.nscount;i++) + if ( addrcmp( (void *) &(myres.nsaddr_list[i].sin_addr), (void *) &(from4->sin_addr), AF_INET ) == 0 ) break; - if (i == _res.nscount) { + if (i == myres.nscount) { sprintf(tempstring,"Resolver error: Received reply from unknown source: %s", inet_ntoa(from4->sin_addr )); restell(tempstring); @ 1.8 log @Fix errno. @ text @d1 1 a1 1 $NetBSD$ @ 1.7 log @Update to 0.69: v0.69 make distclean should now also remove "rej" files. Antonio Querubin: update getopt.h . More cleanups using new infrastructure. rcw: Fixed IPV6 support: When compiled in an IPV6-supporting environment, but when the kernel doesn't support IPV6, mtr would fail to start. v0.68 included some old patches. included patch from Antonio Querubin for better IPV6 support restructured some more whitespace. added mtr.h where "global" things should go. Not finished moving things around, but now that the infrastructure is there, it should be easy. @ text @d1 1 a1 1 $NetBSD: patch-ab,v 1.8 2005/02/01 17:02:00 wiz Exp $ d3 1 a3 1 --- dns.c.orig 2005-01-11 09:32:42.000000000 +0100 d5 5 a9 1 @@@@ -32,9 +32,17 @@@@ d27 11 a37 1 @@@@ -294,6 +302,17 @@@@ char nullstring[] = ""; d55 1 a55 1 @@@@ -468,14 +487,14 @@@@ void dns_open(void) d75 1 a75 1 @@@@ -858,17 +877,17 @@@@ void dorequest(char *s,int type,word id) d97 1 a97 1 @@@@ -1224,18 +1243,18 @@@@ void dns_ack(void) @ 1.6 log @Add patch based on christos' etherape patch-ab to make name lookups work on -current. Bump PKGREVISION. @ text @d1 1 a1 1 $NetBSD$ d3 1 a3 1 --- dns.c.orig 2004-08-26 09:56:53.000000000 +0200 d23 1 a23 1 @@@@ -282,6 +290,17 @@@@ char nullstring[] = ""; d41 1 a41 1 @@@@ -448,14 +467,14 @@@@ void dns_open(void) d61 1 a61 1 @@@@ -814,17 +833,17 @@@@ void dorequest(char *s,int type,word id) d83 1 a83 2 @@@@ -1161,15 +1180,15 @@@@ void dns_ack(void) if (r > 0) { d85 2 a86 1 if (from.sin_addr.s_addr == localhost) { d88 1 a88 2 - if ((_res.nsaddr_list[i].sin_addr.s_addr == from.sin_addr.s_addr) || - (!_res.nsaddr_list[i].sin_addr.s_addr)) /* 0.0.0.0 replies as 127.0.0.1 */ d90 5 a94 2 + if ((myres.nsaddr_list[i].sin_addr.s_addr == from.sin_addr.s_addr) || + (!myres.nsaddr_list[i].sin_addr.s_addr)) /* 0.0.0.0 replies as 127.0.0.1 */ d98 1 a98 1 - if (_res.nsaddr_list[i].sin_addr.s_addr == from.sin_addr.s_addr) d100 2 a101 1 + if (myres.nsaddr_list[i].sin_addr.s_addr == from.sin_addr.s_addr) d106 1 a106 1 inet_ntoa(from.sin_addr)); @ 1.5 log @Update to 0.65, based on PR 27562 by Andreas Wrede. Changes since 0.54: v0.65 Dancer Vesperman noted that mtr no longer traces past a section of non-responding hosts. Apparently I added a line in net.c that didn't make sense in mtr-0.56. I can't find the reason for adding that line, so someone who thinks (s)he needs it, should holler. v0.64 Philippe suggests to do the time_t thingy before socket.h. Apparently, MAC OS X doesn't compile socket.h otherwise. v0.63 Suggestion by RCW: Add -lm at line 70 of Configure.in. On my system no ill effects ensued, so this version released so that he can test if it still works on his sytem. Let me add that it's stupid that I have to specify that this this program now requires Automake version 1.5 to build, where Automake was intended to make software independent of different versions of build software! For those concerned about the above statement: If you're just trying to compile and use MTR, there is no need for automake. Just when you're messing with the configure and build system of mtr is automake a tool you need. v0.62 Apparently someone changed gethostbyname into gethostbyname2 in mtr.c in an attempt to add IPV6 support. For systems without ipv6 support, the old gethostbyname should be used! Linux has the call even if you don't enable IPV6. Thanks Gary (rsub) v0.61 Attempt to get/print the local IP address. Now shows as 0.0.0.0 :-( Hints and tips appreciated! -- REW Lots of blank space reformatting. moved the interface address setting to net.c (where it belongs). v0.60 John Thacker submitted a surprisingly simple patch to enable linking against GTK2. (up to 2.4.0) v0.59 Josh Martin suggested to add some bounds checking to the dynamic field code. This caused me to delve in, and rewrite some things. Now 50 lines of code less, but cleaner code. :-) v0.58 I don't remember. Fogot to update this. :-( Check the patch. v0.57 Lots of whitespace cleanups. And a DNS fix: Don't do DNS lookups in raw mode with -n specified. v0.56 Fixed compile warnings. Now compiles with -Wall. If your compiler finds things mine didn't feel free to shout. v0.55 Cleanup patch. I'm going to do some maintenance on MTR, but I want to be able to say: Can you see which version fixed/broke things for you, so you're going to see a bunch of new releases soon. @ text @d1 1 a1 1 $NetBSD: patch-ab,v 1.4 2003/01/09 16:32:11 mycroft Exp $ d3 59 a61 3 --- dns.c.orig 2004-10-27 11:47:06.000000000 -0400 +++ dns.c 2004-10-27 11:47:52.000000000 -0400 @@@@ -814,9 +814,9 @@@@ d69 1 a69 1 + r = res_mkquery(QUERY,s,C_IN,type,NULL,0,NULL,buf,MaxPacketsize); d73 32 @ 1.4 log @Update from 0.51 to 0.52. Miscellaneous build and portability fixes. @ text @d3 14 a16 13 --- dns.c.orig Sat Nov 23 18:24:16 2002 +++ dns.c Thu Jan 9 16:25:23 2003 @@@@ -743,8 +743,8 @@@@ void dorequest(char *s,int type,word id){ packetheader *hp; int r,i; - int buf[(MaxPacketsize/sizeof (int))+1]; - r = res_mkquery(QUERY,s,C_IN,type,NULL,0,NULL,(unsigned char*)buf,MaxPacketsize); + unsigned char buf[MaxPacketsize]; + r = res_mkquery(QUERY,s,C_IN,type,NULL,0,NULL,buf,MaxPacketsize); if (r == -1){ restell("Resolver error: Query too large."); return; @ 1.3 log @Update mtr packages to 0.49. Changes since 0.42: v0.49 Fix compilation problems on several platforms. v0.48 Draw names in red (GTK) or bold (Curses) if host doesn't respond. v0.47 Fixed a (believed-) non-exploitable bufferoverflow. Thanks Damian. v0.46 Included patch to be able to specify outgoing interface address. v0.45 People are pressuring me to release new versions with their changes. That's fine. Now this version just adds dynamic switching between numeric / dns names, and some minor stuff I forgot. This release serves as a code-sycn-release. new version with even more new stuff in about two weeks! I'm afraid I don't know how to fix the MaxOS-X compilation problems in the source. Help wanted... v0.44 David Stone adds the "last" column to the gtk version. v0.43 Compile fixes. @ text @d1 1 a1 1 $NetBSD: patch-ab,v 1.2 2001/11/04 14:09:32 wiz Exp $ d3 3 a5 3 --- dns.c.orig Sat Mar 4 02:46:55 2000 +++ dns.c @@@@ -751,7 +751,7 @@@@ d10 1 d12 1 a12 1 r = res_mkquery(QUERY,s,C_IN,type,NULL,0,NULL,buf,MaxPacketsize); d15 1 @ 1.2 log @Add patch to add rudimentary cname chasing to the ptr lookup stuff so that classless in-addr lookups work. Patch by atatat. Bump to 0.42nb1. @ text @d1 1 a1 1 $NetBSD: patch-ab,v 1.1 2001/04/05 15:18:09 wiz Exp $ d4 1 a4 1 +++ dns.c Fri Nov 2 14:16:56 2001 a13 28 @@@@ -981,7 +981,7 @@@@ restell("Resolver error: Specified rdata length exceeds packet size."); return; } - if (datatype == qdatatype){ + if (datatype == qdatatype || datatype == T_CNAME){ if (debug){ sprintf(tempstring,"Resolver: TTL: %s",strtdiff(sendstring,ttl)); restell(tempstring); @@@@ -1013,6 +1013,7 @@@@ } break; case T_PTR: + case T_CNAME: *namestring = '\0'; r = dn_expand(s,s + l,c,namestring,MAXDNAME); if (r == -1){ @@@@ -1027,6 +1028,10 @@@@ restell("Resolver error: Domain name too long."); failrp(rp); return; + } + if (datatype == T_CNAME){ + strcpy(stackstring,namestring); + break; } if (!rp->hostname){ rp->hostname = (char *)statmalloc(strlen(namestring) + 1); @ 1.1 log @Initial revision @ text @d3 2 a4 2 --- dns.c.orig Wed Jun 9 11:09:20 1999 +++ dns.c Tue Aug 10 01:21:12 1999 d14 28 @ 1.1.1.1 log @Import the mtr-gtk-0.42 package, split off from the standard curses-based package, to make things easier for those who may prefer not to link in all of the gtk-based functionality. @ text @@