diff -ur mtr-0.51/AUTHORS mtr-0.52/AUTHORS
--- mtr-0.51/AUTHORS	Tue May  7 07:52:45 2002
+++ mtr-0.52/AUTHORS	Sat Nov 23 19:07:03 2002
@@ -36,6 +36,7 @@
         Simon Kirby
         Christophe Kalt
         Steve Kann (stevek@spheara.horizonlive.com)
+        Brett Johnson (brett@jdacareers.com)
         Damian Gryski (dgryski@uwaterloo.ca)
         Mircea Damian
         Cougar (cougar@random.ee)
diff -ur mtr-0.51/Makefile.am mtr-0.52/Makefile.am
--- mtr-0.51/Makefile.am	Thu Mar  7 13:19:11 2002
+++ mtr-0.52/Makefile.am	Sat Nov 23 18:18:31 2002
@@ -3,7 +3,7 @@
 sbin_PROGRAMS = mtr
 man_MANS = mtr.8
 install-exec-am: 
-	chmod u+s $(sbindir)/mtr
+	chmod u+s $(DESTDIR)$(sbindir)/mtr
 
 mtr_SOURCES = mtr.c \
               net.c net.h \
diff -ur mtr-0.51/Makefile.in mtr-0.52/Makefile.in
--- mtr-0.51/Makefile.in	Tue May  7 07:54:38 2002
+++ mtr-0.52/Makefile.in	Sat Nov 23 18:19:27 2002
@@ -1,4 +1,4 @@
-# Makefile.in generated automatically by automake 1.4 from Makefile.am
+# Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
 
 # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
@@ -129,7 +129,7 @@
 $(ACLOCAL_M4):  configure.in 
 	cd $(srcdir) && $(ACLOCAL)
 
-config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+config.status: $(srcdir)/configure.in $(CONFIG_STATUS_DEPENDENCIES)
 	$(SHELL) ./config.status --recheck
 $(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
 	cd $(srcdir) && $(AUTOCONF)
@@ -379,7 +379,7 @@
 	@for file in $(DISTFILES); do \
 	  d=$(srcdir); \
 	  if test -d $$d/$$file; then \
-	    cp -pr $$/$$file $(distdir)/$$file; \
+	    cp -pr $$d/$$file $(distdir)/$$file; \
 	  else \
 	    test -f $(distdir)/$$file \
 	    || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
@@ -483,7 +483,7 @@
 maintainer-clean-generic clean mostlyclean distclean maintainer-clean
 
 install-exec-am: 
-	chmod u+s $(sbindir)/mtr
+	chmod u+s $(DESTDIR)$(sbindir)/mtr
 distclean-local:
 	cp Makefile.dist Makefile
 	rm -f *.orig
diff -ur mtr-0.51/NEWS mtr-0.52/NEWS
--- mtr-0.51/NEWS	Wed May 15 15:14:23 2002
+++ mtr-0.52/NEWS	Sat Nov 23 19:14:49 2002
@@ -1,5 +1,8 @@
 WHAT'S NEW?
 
+  v0.52 Mostly cleanups from Brett Johnson on MacOS X. It may 
+        clean up some compilation problems on MacOS X as well. 
+
   v0.51 Fixed the bug introduced by the previous select loop fix... 
         Thanks Evgeniy
 
diff -ur mtr-0.51/aclocal.m4 mtr-0.52/aclocal.m4
--- mtr-0.51/aclocal.m4	Tue May  7 07:54:38 2002
+++ mtr-0.52/aclocal.m4	Sat Nov 23 18:19:27 2002
@@ -1,4 +1,4 @@
-dnl aclocal.m4 generated automatically by aclocal 1.4
+dnl aclocal.m4 generated automatically by aclocal 1.4-p4
 
 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
diff -ur mtr-0.51/config.h.in mtr-0.52/config.h.in
--- mtr-0.51/config.h.in	Thu Mar  7 13:19:11 2002
+++ mtr-0.52/config.h.in	Sat Nov 23 18:19:30 2002
@@ -1,4 +1,4 @@
-/* config.h.in.  Generated automatically from configure.in by autoheader.  */
+/* config.h.in.  Generated automatically from configure.in by autoheader 2.13.  */
 
 /* Define if you don't have the GTK+ libraries available.  */
 #undef NO_GTK
diff -ur mtr-0.51/configure mtr-0.52/configure
--- mtr-0.51/configure	Tue May  7 07:54:39 2002
+++ mtr-0.52/configure	Sat Nov 23 18:19:27 2002
@@ -699,7 +699,7 @@
 
 PACKAGE=mtr
 
-VERSION=0.51
+VERSION=0.52
 
 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
@@ -1023,6 +1023,7 @@
 #line 1024 "configure"
 #include "confdefs.h"
 #include <stdio.h>
+#include <sys/types.h>
 main()
 {
   FILE *f=fopen("conftestval", "w");
@@ -1031,7 +1032,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:1035: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1036: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_unsigned_char=`cat conftestval`
 else
@@ -1051,7 +1052,7 @@
 
 
 echo $ac_n "checking size of unsigned short""... $ac_c" 1>&6
-echo "configure:1055: checking size of unsigned short" >&5
+echo "configure:1056: checking size of unsigned short" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_unsigned_short'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1059,9 +1060,10 @@
   ac_cv_sizeof_unsigned_short=2
 else
   cat > conftest.$ac_ext <<EOF
-#line 1063 "configure"
+#line 1064 "configure"
 #include "confdefs.h"
 #include <stdio.h>
+#include <sys/types.h>
 main()
 {
   FILE *f=fopen("conftestval", "w");
@@ -1070,7 +1072,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:1074: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_unsigned_short=`cat conftestval`
 else
@@ -1090,7 +1092,7 @@
 
 
 echo $ac_n "checking size of unsigned int""... $ac_c" 1>&6
-echo "configure:1094: checking size of unsigned int" >&5
+echo "configure:1096: checking size of unsigned int" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_unsigned_int'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1098,9 +1100,10 @@
   ac_cv_sizeof_unsigned_int=4
 else
   cat > conftest.$ac_ext <<EOF
-#line 1102 "configure"
+#line 1104 "configure"
 #include "confdefs.h"
 #include <stdio.h>
+#include <sys/types.h>
 main()
 {
   FILE *f=fopen("conftestval", "w");
@@ -1109,7 +1112,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:1113: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1116: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_unsigned_int=`cat conftestval`
 else
@@ -1129,7 +1132,7 @@
 
 
 echo $ac_n "checking size of unsigned long""... $ac_c" 1>&6
-echo "configure:1133: checking size of unsigned long" >&5
+echo "configure:1136: checking size of unsigned long" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_unsigned_long'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1137,9 +1140,10 @@
   ac_cv_sizeof_unsigned_long=4
 else
   cat > conftest.$ac_ext <<EOF
-#line 1141 "configure"
+#line 1144 "configure"
 #include "confdefs.h"
 #include <stdio.h>
+#include <sys/types.h>
 main()
 {
   FILE *f=fopen("conftestval", "w");
@@ -1148,7 +1152,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:1152: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1156: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_unsigned_long=`cat conftestval`
 else
@@ -1176,7 +1180,7 @@
 # We have to trust the linker not to mess things up... (It should not
 # pull in anything if we don't refer to anything in the lib). 
 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
-echo "configure:1180: checking for tgetent in -ltermcap" >&5
+echo "configure:1184: checking for tgetent in -ltermcap" >&5
 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1184,7 +1188,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-ltermcap  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1188 "configure"
+#line 1192 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1195,7 +1199,7 @@
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:1199: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1203: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1224,12 +1228,12 @@
 
 
 echo $ac_n "checking for initscr""... $ac_c" 1>&6
-echo "configure:1228: checking for initscr" >&5
+echo "configure:1232: checking for initscr" >&5
 if eval "test \"`echo '$''{'ac_cv_func_initscr'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1233 "configure"
+#line 1237 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char initscr(); below.  */
@@ -1252,7 +1256,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:1256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1260: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_initscr=yes"
 else
@@ -1270,7 +1274,7 @@
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
-echo "configure:1274: checking for initscr in -lncurses" >&5
+echo "configure:1278: checking for initscr in -lncurses" >&5
 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1278,7 +1282,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lncurses  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1282 "configure"
+#line 1286 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1289,7 +1293,7 @@
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:1293: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1297: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1315,7 +1319,7 @@
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for initscr in -lcurses""... $ac_c" 1>&6
-echo "configure:1319: checking for initscr in -lcurses" >&5
+echo "configure:1323: checking for initscr in -lcurses" >&5
 ac_lib_var=`echo curses'_'initscr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1323,7 +1327,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lcurses  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1327 "configure"
+#line 1331 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1334,7 +1338,7 @@
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:1338: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1342: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1360,7 +1364,7 @@
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for initscr in -lcursesX""... $ac_c" 1>&6
-echo "configure:1364: checking for initscr in -lcursesX" >&5
+echo "configure:1368: checking for initscr in -lcursesX" >&5
 ac_lib_var=`echo cursesX'_'initscr | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1368,7 +1372,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lcursesX  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1372 "configure"
+#line 1376 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1379,7 +1383,7 @@
 initscr()
 ; return 0; }
 EOF
-if { (eval echo configure:1383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1387: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1422,12 +1426,12 @@
 for ac_func in attron
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1426: checking for $ac_func" >&5
+echo "configure:1430: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1431 "configure"
+#line 1435 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -1450,7 +1454,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:1454: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1458: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -1477,7 +1481,7 @@
 
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1481: checking how to run the C preprocessor" >&5
+echo "configure:1485: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -1492,13 +1496,13 @@
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 1496 "configure"
+#line 1500 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1502: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1506: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1509,13 +1513,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 1513 "configure"
+#line 1517 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1519: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1523: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1526,13 +1530,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 1530 "configure"
+#line 1534 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1536: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1540: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -1560,17 +1564,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1564: checking for $ac_hdr" >&5
+echo "configure:1568: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1569 "configure"
+#line 1573 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1574: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1578: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1600,17 +1604,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1604: checking for $ac_hdr" >&5
+echo "configure:1608: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1609 "configure"
+#line 1613 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1614: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1618: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1638,7 +1642,7 @@
 
 
 echo $ac_n "checking for floor in -lm""... $ac_c" 1>&6
-echo "configure:1642: checking for floor in -lm" >&5
+echo "configure:1646: checking for floor in -lm" >&5
 ac_lib_var=`echo m'_'floor | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1646,7 +1650,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1650 "configure"
+#line 1654 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1657,7 +1661,7 @@
 floor()
 ; return 0; }
 EOF
-if { (eval echo configure:1661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1665: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1746,7 +1750,7 @@
   # Extract the first word of "gtk-config", so it can be a program name with args.
 set dummy gtk-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1750: checking for $ac_word" >&5
+echo "configure:1754: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GTK_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1781,7 +1785,7 @@
 
   min_gtk_version=1.0.0
   echo $ac_n "checking for GTK - version >= $min_gtk_version""... $ac_c" 1>&6
-echo "configure:1785: checking for GTK - version >= $min_gtk_version" >&5
+echo "configure:1789: checking for GTK - version >= $min_gtk_version" >&5
   no_gtk=""
   if test "$GTK_CONFIG" = "no" ; then
     no_gtk=yes
@@ -1804,7 +1808,7 @@
   echo $ac_n "cross compiling; assumed OK... $ac_c"
 else
   cat > conftest.$ac_ext <<EOF
-#line 1808 "configure"
+#line 1812 "configure"
 #include "confdefs.h"
 
 #include <gtk/gtk.h>
@@ -1882,7 +1886,7 @@
 }
 
 EOF
-if { (eval echo configure:1886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1890: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -1917,7 +1921,7 @@
           CFLAGS="$CFLAGS $GTK_CFLAGS"
           LIBS="$LIBS $GTK_LIBS"
           cat > conftest.$ac_ext <<EOF
-#line 1921 "configure"
+#line 1925 "configure"
 #include "confdefs.h"
 
 #include <gtk/gtk.h>
@@ -1927,7 +1931,7 @@
  return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); 
 ; return 0; }
 EOF
-if { (eval echo configure:1931: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1935: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
    echo "*** The test program compiled, but did not run. This usually means"
           echo "*** that the run-time linker is not finding GTK or finding the wrong"
@@ -1979,12 +1983,12 @@
 fi
 
 echo $ac_n "checking for socket""... $ac_c" 1>&6
-echo "configure:1983: checking for socket" >&5
+echo "configure:1987: checking for socket" >&5
 if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1988 "configure"
+#line 1992 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char socket(); below.  */
@@ -2007,7 +2011,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2011: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2015: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_socket=yes"
 else
@@ -2025,7 +2029,7 @@
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
-echo "configure:2029: checking for socket in -lsocket" >&5
+echo "configure:2033: checking for socket in -lsocket" >&5
 ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2033,7 +2037,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2037 "configure"
+#line 2041 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2044,7 +2048,7 @@
 socket()
 ; return 0; }
 EOF
-if { (eval echo configure:2048: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2052: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2076,12 +2080,12 @@
 
 
 echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:2080: checking for gethostbyname" >&5
+echo "configure:2084: checking for gethostbyname" >&5
 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2085 "configure"
+#line 2089 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gethostbyname(); below.  */
@@ -2104,7 +2108,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2108: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2112: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_gethostbyname=yes"
 else
@@ -2122,7 +2126,7 @@
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:2126: checking for gethostbyname in -lnsl" >&5
+echo "configure:2130: checking for gethostbyname in -lnsl" >&5
 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2130,7 +2134,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2134 "configure"
+#line 2138 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2141,7 +2145,7 @@
 gethostbyname()
 ; return 0; }
 EOF
-if { (eval echo configure:2145: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2149: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2179,12 +2183,12 @@
 for ac_func in seteuid
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2183: checking for $ac_func" >&5
+echo "configure:2187: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2188 "configure"
+#line 2192 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2207,7 +2211,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2211: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2215: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2234,12 +2238,12 @@
 #  AC_CHECK_FUNC(setuid, , AC_MSG_ERROR (I Need either seteuid or setuid))
 
 echo $ac_n "checking for res_mkquery""... $ac_c" 1>&6
-echo "configure:2238: checking for res_mkquery" >&5
+echo "configure:2242: checking for res_mkquery" >&5
 if eval "test \"`echo '$''{'ac_cv_func_res_mkquery'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2243 "configure"
+#line 2247 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char res_mkquery(); below.  */
@@ -2262,7 +2266,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_res_mkquery=yes"
 else
@@ -2280,7 +2284,7 @@
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for res_mkquery in -lbind""... $ac_c" 1>&6
-echo "configure:2284: checking for res_mkquery in -lbind" >&5
+echo "configure:2288: checking for res_mkquery in -lbind" >&5
 ac_lib_var=`echo bind'_'res_mkquery | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2288,7 +2292,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lbind  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2292 "configure"
+#line 2296 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2299,7 +2303,7 @@
 res_mkquery()
 ; return 0; }
 EOF
-if { (eval echo configure:2303: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2307: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2325,7 +2329,7 @@
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for res_mkquery in -lresolv""... $ac_c" 1>&6
-echo "configure:2329: checking for res_mkquery in -lresolv" >&5
+echo "configure:2333: checking for res_mkquery in -lresolv" >&5
 ac_lib_var=`echo resolv'_'res_mkquery | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2333,7 +2337,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lresolv  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2337 "configure"
+#line 2341 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2344,7 +2348,7 @@
 res_mkquery()
 ; return 0; }
 EOF
-if { (eval echo configure:2348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2352: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2378,12 +2382,12 @@
 
 
 echo $ac_n "checking for herror""... $ac_c" 1>&6
-echo "configure:2382: checking for herror" >&5
+echo "configure:2386: checking for herror" >&5
 if eval "test \"`echo '$''{'ac_cv_func_herror'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2387 "configure"
+#line 2391 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char herror(); below.  */
@@ -2406,7 +2410,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_herror=yes"
 else
@@ -2430,12 +2434,12 @@
 fi
 
 echo $ac_n "checking for strerror""... $ac_c" 1>&6
-echo "configure:2434: checking for strerror" >&5
+echo "configure:2438: checking for strerror" >&5
 if eval "test \"`echo '$''{'ac_cv_func_strerror'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2439 "configure"
+#line 2443 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char strerror(); below.  */
@@ -2458,7 +2462,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2462: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2466: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_strerror=yes"
 else
diff -ur mtr-0.51/configure.in mtr-0.52/configure.in
--- mtr-0.51/configure.in	Tue May  7 07:54:37 2002
+++ mtr-0.52/configure.in	Sat Nov 23 18:19:02 2002
@@ -1,5 +1,5 @@
 AC_INIT(mtr.c)
-AM_INIT_AUTOMAKE(mtr, 0.51)
+AM_INIT_AUTOMAKE(mtr, 0.52)
 
 AC_SUBST(GTK_OBJ)
 AC_SUBST(CURSES_OBJ)
diff -ur mtr-0.51/curses.c mtr-0.52/curses.c
--- mtr-0.51/curses.c	Thu Mar  7 13:19:11 2002
+++ mtr-0.52/curses.c	Sat Nov 23 01:33:30 2002
@@ -22,6 +22,7 @@
 #ifndef NO_CURSES
 #include <ctype.h>
 #include <stdlib.h>
+#include <string.h>
 
 #if defined(HAVE_NCURSES_H)
 #  include <ncurses.h>
@@ -188,7 +189,6 @@
 void mtr_fill_graph(int at, int cols) {
 	int* saved;
 	int i;
-	int val;
 
 	saved = net_saved_pings(at);
 	for (i = SAVED_PINGS-cols; i < SAVED_PINGS; i++) {
diff -ur mtr-0.51/display.c mtr-0.52/display.c
--- mtr-0.51/display.c	Thu Mar  7 13:19:11 2002
+++ mtr-0.52/display.c	Sat Nov 23 18:52:15 2002
@@ -18,11 +18,13 @@
 */
 
 #include <config.h>
+#include <stdio.h>
 #include "display.h"
 #include "mtr-curses.h"
 #include "mtr-gtk.h"
 #include "report.h"
 #include "select.h"
+#include "raw.h"
 
 extern int DisplayMode;
 
@@ -32,14 +34,18 @@
 #define mtr_curses_redraw()
 #define mtr_curses_keyaction()
 #define mtr_curses_clear()
+#else
+#include "mtr-curses.h"
 #endif
 
 #ifdef NO_GTK
 #define gtk_open()
 #define gtk_close()
 #define gtk_redraw()
-#define gtk_keyaction()
-#define gtk_loop()
+#define gtk_keyaction() 0
+#define gtk_loop() {fprintf (stderr, "No GTK support. Sorry.\n"); exit (1); } 
+#else
+#include "mtr-gtk.h"
 #endif
 
 #ifdef NO_SPLIT
@@ -47,6 +53,8 @@
 #define split_close()
 #define split_redraw()
 #define split_keyaction() 0
+#else
+#include "split.h"
 #endif
 
 void display_detect(int *argc, char ***argv) {
diff -ur mtr-0.51/dns.c mtr-0.52/dns.c
--- mtr-0.51/dns.c	Thu Mar  7 13:19:11 2002
+++ mtr-0.52/dns.c	Sat Nov 23 19:24:16 2002
@@ -314,8 +314,8 @@
    mallocsize = size + TOT_SLACK * sizeof(dword);
 
    p = malloc(mallocsize);
-   if (!p){
-      fprintf(stderr,"malloc() of %u bytes failed: %s\n",size,strerror(errno));
+   if (!p) {
+      fprintf(stderr,"malloc() of %u bytes failed: %s\n", (unsigned int)size, strerror(errno));
       exit(-1);
    }
    *((dword *)p) = (dword)size;
@@ -515,11 +515,8 @@
 void unlinkresolveid(struct resolve *rp){
    dword bashnum;
    bashnum = getidbash(rp->id);
-   if (idbash[bashnum] == rp)
-      if (rp->previousid)
-         idbash[bashnum] = rp->previousid;
-      else
-         idbash[bashnum] = rp->nextid;
+   if (idbash[bashnum] == rp) 
+     idbash[bashnum] = (rp->previousid)? rp->previousid : rp->nextid;
    if (rp->nextid)
       rp->nextid->previousid = rp->previousid;
    if (rp->previousid)
@@ -558,10 +555,7 @@
    dword bashnum;
    bashnum = gethostbash(rp->hostname);
    if (hostbash[bashnum] == rp)
-      if (rp->previoushost)
-         hostbash[bashnum] = rp->previoushost;
-      else
-         hostbash[bashnum] = rp->nexthost;
+      hostbash[bashnum] = (rp->previoushost)? rp->previoushost : rp->nexthost;
    if (rp->nexthost)
       rp->nexthost->previoushost = rp->previoushost;
    if (rp->previoushost)
@@ -601,10 +595,7 @@
    dword bashnum;
    bashnum = getipbash(rp->ip);
    if (ipbash[bashnum] == rp)
-      if (rp->previousip)
-         ipbash[bashnum] = rp->previousip;
-      else
-         ipbash[bashnum] = rp->nextip;
+      ipbash[bashnum] = (rp->previousip)? rp->previousip : rp->nextip;
    if (rp->nextip)
       rp->nextip->previousip = rp->previousip;
    if (rp->previousip)
@@ -753,7 +744,7 @@
    packetheader *hp;
    int r,i;
    int buf[(MaxPacketsize/sizeof (int))+1];
-   r = res_mkquery(QUERY,s,C_IN,type,NULL,0,NULL,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;
@@ -1107,13 +1098,14 @@
 }
 
 int istime(double x,double *sinterval){
-   if (x)
-      if (x > sweeptime){
+  if (x) {
+      if (x > sweeptime) {
          if (*sinterval > x - sweeptime)
             *sinterval = x - sweeptime;
       } else
          return 1;
-   return 0;
+  }
+  return 0;
 }
 
 void dns_events(double *sinterval){
diff -ur mtr-0.51/getopt.c mtr-0.52/getopt.c
--- mtr-0.51/getopt.c	Thu Mar  7 13:19:11 2002
+++ mtr-0.52/getopt.c	Sat Nov 23 01:25:32 2002
@@ -39,6 +39,7 @@
 #endif
 
 #include <stdio.h>
+#include <string.h>
 
 /* Comment out all this code if we are using the GNU C Library, and are not
    actually compiling the library itself.  This code is part of the GNU C
@@ -486,7 +487,7 @@
       const struct option *pfound = NULL;
       int exact = 0;
       int ambig = 0;
-      int indfound;
+      int indfound = 0;
       int option_index;
 
       for (nameend = nextchar; *nameend && *nameend != '='; nameend++)
@@ -538,7 +539,7 @@
 		optarg = nameend + 1;
 	      else
 		{
-		  if (opterr)
+		  if (opterr) {
 		   if (argv[optind - 1][1] == '-')
 		    /* --option */
 		    fprintf (stderr,
@@ -549,7 +550,7 @@
 		    fprintf (stderr,
 		     _("%s: option `%c%s' doesn't allow an argument\n"),
 		     argv[0], argv[optind - 1][0], pfound->name);
-
+		  } 
 		  nextchar += strlen (nextchar);
 		  return '?';
 		}
diff -ur mtr-0.51/gtk.c mtr-0.52/gtk.c
--- mtr-0.51/gtk.c	Thu Mar  7 13:19:11 2002
+++ mtr-0.52/gtk.c	Sat Nov 23 18:15:03 2002
@@ -301,7 +301,7 @@
   if (net_up(row)) {
     gdk_color_black(cmap, &color);
   } else {
-    color.red = 0xffffff;
+    color.red = 0xffff;
     color.green = 0;
     color.blue = 0;
   }
diff -ur mtr-0.51/img/Makefile.in mtr-0.52/img/Makefile.in
--- mtr-0.51/img/Makefile.in	Wed May 15 15:13:15 2002
+++ mtr-0.52/img/Makefile.in	Sat Nov 23 18:19:30 2002
@@ -1,4 +1,4 @@
-# Makefile.in generated automatically by automake 1.4 from Makefile.am
+# Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
 
 # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
 # This Makefile.in is free software; the Free Software Foundation
@@ -99,7 +99,7 @@
 	@for file in $(DISTFILES); do \
 	  d=$(srcdir); \
 	  if test -d $$d/$$file; then \
-	    cp -pr $$/$$file $(distdir)/$$file; \
+	    cp -pr $$d/$$file $(distdir)/$$file; \
 	  else \
 	    test -f $(distdir)/$$file \
 	    || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
diff -ur mtr-0.51/mtr.8 mtr-0.52/mtr.8
--- mtr-0.51/mtr.8	Thu Mar  7 13:19:11 2002
+++ mtr-0.52/mtr.8	Sat Nov 23 18:40:47 2002
@@ -65,11 +65,15 @@
 .B mtr
 runs on and 
 .BR HOSTNAME . 
-After it determines the address of each network hop between the
-machines, it sends a sequence ICMP ECHO requests to each one to
-determine the quality of the link to each machine.  As it does this,
-it prints running statistics about each machine.
-
+by sending packets with purposly low TTLs. It continues to send
+packets with low TTL, noting the response time of the intervening
+routers.  This allows 
+.B mtr 
+to print the response percentage and response times of the internet
+route to 
+.BR HOSTNAME . 
+A sudden increase in packetloss or response time is often an indication
+of a bad (or simply overloaded) link. 
 
 .SH OPTIONS
 
diff -ur mtr-0.51/mtr.c mtr-0.52/mtr.c
--- mtr-0.51/mtr.c	Sat Mar 30 19:30:50 2002
+++ mtr-0.52/mtr.c	Sat Nov 23 18:24:05 2002
@@ -17,6 +17,7 @@
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
+#include <sys/types.h>
 #include <config.h>
 #include <netdb.h>
 #include <stdio.h>
@@ -24,6 +25,7 @@
 #include <string.h>
 #include <netinet/in.h>
 #include <sys/socket.h> 
+#include <unistd.h>
 
 #include "mtr-curses.h"
 #include "getopt.h"
@@ -139,7 +141,6 @@
 {
   int argc;
   char *argv[128], *p;
-  int i;
 
   if (!string) return;
 
@@ -212,29 +213,28 @@
 
 
   if(InterfaceAddress) { /* Mostly borrowed from ping(1) code */
-    struct sockaddr_in source;
     int i1, i2, i3, i4;
     char dummy;
-    extern int sendsock; /* from net.c:115 */
+    extern int sendsock; /* from net.c:118 */
+    extern struct sockaddr_in sourceaddress; /* from net.c:120 */
 
-    bzero(&source, sizeof(source)); /* -- Evgeniy Tretyak */
-
-    source.sin_family = AF_INET;
-    source.sin_port = 0;
+    sourceaddress.sin_family = AF_INET;
+    sourceaddress.sin_port = 0;
+    sourceaddress.sin_addr.s_addr = 0;
 
     if(sscanf(InterfaceAddress, "%u.%u.%u.%u%c", &i1, &i2, &i3, &i4, &dummy) != 4) {
       printf("mtr: bad interface address: %s\n", InterfaceAddress);
       exit(1);
     } else {
       unsigned char*ptr;
-      ptr = (unsigned char*)&source.sin_addr;
+      ptr = (unsigned char*)&sourceaddress.sin_addr;
       ptr[0] = i1;
       ptr[1] = i2;
       ptr[2] = i3;
       ptr[3] = i4;
     }
 
-    if(bind(sendsock, (struct sockaddr*)&source, sizeof(source)) == -1) {
+    if(bind(sendsock, (struct sockaddr*)&sourceaddress, sizeof(sourceaddress)) == -1) {
       perror("mtr: failed to bind to interface");
       exit(1);
     }
diff -ur mtr-0.51/net.c mtr-0.52/net.c
--- mtr-0.51/net.c	Thu Mar  7 13:19:11 2002
+++ mtr-0.52/net.c	Sat Nov 23 18:24:05 2002
@@ -37,7 +37,7 @@
 #include <errno.h>
 
 #include "net.h"
-
+#include "display.h"
 
 
 #define MaxTransit 4
@@ -79,7 +79,7 @@
 #define SOL_IP 0
 #endif
 
-
+#define saddr_correction(addr) BSDfix ? addr : 0
 
 struct nethost {
   uint32 addr;
@@ -117,6 +117,7 @@
 int timestamp;
 int sendsock;
 int recvsock;
+struct sockaddr_in sourceaddress;
 struct sockaddr_in remoteaddress;
 static int batch_at = 0;
 
@@ -201,7 +202,8 @@
   ip->frag = 0;
   ip->ttl = index + 1;
   ip->protocol = IPPROTO_ICMP;
-  ip->saddr = 0;
+  /* BSD needs the source address here, Linux & others do not... */
+  ip->saddr = saddr_correction(sourceaddress.sin_addr.s_addr);
   ip->daddr = remoteaddress.sin_addr.s_addr;
 
   icmp->type = ICMP_ECHO;
@@ -275,7 +277,6 @@
   struct sockaddr_in fromaddr;
   int fromaddrsize;
   int num;
-  int at;
   struct ICMPHeader *header;
   struct timeval now;
 
diff -ur mtr-0.51/net.h mtr-0.52/net.h
--- mtr-0.51/net.h	Thu Mar  7 13:19:11 2002
+++ mtr-0.52/net.h	Sat Nov 23 01:30:49 2002
@@ -31,6 +31,7 @@
 int net_percent(int at);
 int net_best(int at);
 int net_worst(int at);
+int net_last(int at);
 int net_avg(int at);
 int net_send_batch();
 void net_end_transit();
diff -ur mtr-0.51/select.c mtr-0.52/select.c
--- mtr-0.51/select.c	Wed May 15 15:12:51 2002
+++ mtr-0.52/select.c	Sat Nov 23 01:53:35 2002
@@ -20,6 +20,8 @@
 #include <config.h>
 #include <sys/types.h>
 #include <sys/time.h>
+#include <stdlib.h>
+#include <stdio.h>
 #include <unistd.h>
 #include <time.h>
 #include <sys/select.h>
@@ -47,7 +49,6 @@
   int NumPing;
   int paused;
   struct timeval lasttime, thistime, selecttime;
-  float wt;
   int dt;
   int rv; 
 
diff -ur mtr-0.51/split.c mtr-0.52/split.c
--- mtr-0.51/split.c	Thu Mar  7 13:19:11 2002
+++ mtr-0.52/split.c	Sat Nov 23 01:25:45 2002
@@ -24,13 +24,14 @@
 #include <ctype.h>
 #include <stdlib.h>
 #include <stdio.h>
+#include <string.h>
 
 #include "display.h"
 #include "dns.h"
-/*
+
 #include "net.h"
 #include "split.h"
-*/
+
 
 #include <config.h>
 
