michael@64: Index: configure michael@64: --- configure.orig 2006-06-21 22:32:38.000000000 +0200 michael@64: +++ configure 2006-10-20 15:30:45.862899000 +0200 michael@64: @@ -5259,11 +5259,7 @@ michael@64: echo "$as_me:$LINENO: result: $ac_cv_lbl_have_" >&5 michael@64: echo "${ECHO_T}$ac_cv_lbl_have_" >&6 michael@64: if test $ac_cv_lbl_have_ = no ; then michael@64: - michael@64: -cat >>confdefs.h <<\_ACEOF michael@64: -#define michael@64: -_ACEOF michael@64: - michael@64: + : michael@64: fi michael@64: michael@64: rm -f os-proto.h michael@64: Index: Makefile.in michael@64: --- Makefile.in.orig 2000-06-15 02:39:55.000000000 +0200 michael@64: +++ Makefile.in 2006-10-20 17:41:03.246914000 +0200 michael@64: @@ -31,7 +31,7 @@ michael@64: # Pathname of directory to install the man page michael@64: MANDEST = @mandir@ michael@64: # Pathname of directory to install database file michael@64: -ARPDIR = $(prefix)/arpwatch michael@64: +ARPDIR = @localstatedir@ michael@64: michael@64: # VPATH michael@64: srcdir = @srcdir@ michael@64: @@ -42,16 +42,17 @@ michael@64: # michael@64: michael@64: CC = @CC@ michael@64: +CFLAGS = @CFLAGS@ michael@64: +CPPFLAGS = @CPPFLAGS@ michael@64: + michael@64: PROG = arpwatch michael@64: CCOPT = @V_CCOPT@ michael@64: INCLS = -I. @V_INCLS@ michael@64: DEFS = -DDEBUG @DEFS@ -DARPDIR=\"$(ARPDIR)\" -DPATH_SENDMAIL=\"$(SENDMAIL)\" michael@64: michael@64: -# Standard CFLAGS michael@64: -CFLAGS = $(CCOPT) $(DEFS) $(INCLS) michael@64: - michael@64: # Standard LIBS michael@64: LIBS = @LIBS@ michael@64: +LDFLAGS = @LDFLAGS@ michael@64: # Standard LIBS without libpcap.a michael@64: SLIBS = @LBL_LIBS@ michael@64: michael@64: @@ -63,7 +64,7 @@ michael@64: # problem if you don't own the file but can write to the directory. michael@64: .c.o: michael@64: @rm -f $@ michael@64: - $(CC) $(CFLAGS) -c $(srcdir)/$*.c michael@64: + $(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) -c $(srcdir)/$*.c michael@64: michael@64: CSRC = db.c dns.c ec.c file.c intoa.c machdep.c util.c report.c setsignal.c michael@64: WSRC = arpwatch.c michael@64: @@ -95,11 +96,11 @@ michael@64: michael@64: arpwatch: $(WOBJ) @V_PCAPDEP@ michael@64: @rm -f $@ michael@64: - $(CC) $(CFLAGS) -o $@ $(WOBJ) $(LIBS) michael@64: + $(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) -o $@ $(WOBJ) $(LDFLAGS) $(LIBS) michael@64: michael@64: arpsnmp: $(SOBJ) michael@64: @rm -f $@ michael@64: - $(CC) $(CFLAGS) -o $@ $(SOBJ) $(SLIBS) michael@64: + $(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) -o $@ $(SOBJ) $(LDFLAGS) $(SLIBS) michael@64: michael@64: version.o: version.c michael@64: version.c: $(srcdir)/VERSION michael@64: @@ -107,18 +108,22 @@ michael@64: sed -e 's/.*/char version[] = "&";/' $(srcdir)/VERSION > $@ michael@64: michael@64: zap: zap.o intoa.o michael@64: - $(CC) $(CFLAGS) -o $@ zap.o intoa.o -lutil michael@64: + $(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) -o $@ zap.o intoa.o $(LDFLAGS) -lutil michael@64: michael@64: install: force michael@64: - $(INSTALL) -m 555 -o bin -g bin arpwatch $(DESTDIR)$(BINDEST) michael@64: - $(INSTALL) -m 555 -o bin -g bin arpsnmp $(DESTDIR)$(BINDEST) michael@64: + $(INSTALL) -s -m 555 arpwatch $(DESTDIR)$(BINDEST) michael@64: + $(INSTALL) -s -m 555 arpsnmp $(DESTDIR)$(BINDEST) michael@64: michael@64: install-man: force michael@64: - $(INSTALL) -m 444 -o bin -g bin $(srcdir)/arpwatch.8 \ michael@64: + $(INSTALL) -m 644 $(srcdir)/arpwatch.8 \ michael@64: $(DESTDIR)$(MANDEST)/man8 michael@64: - $(INSTALL) -m 444 -o bin -g bin $(srcdir)/arpsnmp.8 \ michael@64: + $(INSTALL) -m 644 $(srcdir)/arpsnmp.8 \ michael@64: $(DESTDIR)$(MANDEST)/man8 michael@64: michael@64: +install-data: force michael@64: + $(INSTALL) -m 444 $(srcdir)/ethercodes.dat \ michael@64: + $(DESTDIR)$(ARPDIR) michael@64: + michael@64: lint: $(GENSRC) force michael@64: lint -hbxn $(SRC) | \ michael@64: grep -v 'struct/union .* never defined' | \ michael@64: Index: arpwatch.8 michael@64: --- arpwatch.8.orig 2006-10-20 16:13:53.268590000 +0200 michael@64: +++ arpwatch.8 2006-10-20 16:15:01.537612000 +0200 michael@64: @@ -152,9 +152,8 @@ michael@64: .na michael@64: .nh michael@64: .nf michael@64: -/usr/operator/arpwatch - default directory michael@64: -arp.dat - ethernet/ip address database michael@64: -ethercodes.dat - vendor ethernet block list michael@64: +@l_prefix@/var/arpwatch/arp.dat - ethernet/ip address database michael@64: +@l_prefix@/var/arpwatch/ethercodes.dat - vendor ethernet block list michael@64: .ad michael@64: .hy michael@64: .fi michael@64: Index: arpsnmp.8 michael@64: --- arpsnmp.8.orig 2006-10-20 16:14:50.412624000 +0200 michael@64: +++ arpsnmp.8 2006-10-20 16:14:59.301665000 +0200 michael@64: @@ -69,9 +69,8 @@ michael@64: .na michael@64: .nh michael@64: .nf michael@64: -/usr/operator/arpwatch - default directory michael@64: -arp.dat - ethernet/ip address database michael@64: -ethercodes.dat - vendor ethernet block list michael@64: +@l_prefix@/var/arpwatch/arp.dat - ethernet/ip address database michael@64: +@l_prefix@/var/arpwatch/ethercodes.dat - vendor ethernet block list michael@64: .ad michael@64: .hy michael@64: .fi michael@64: Index: arpwatch.h michael@64: --- arpwatch.h.orig 2000-10-01 01:40:55.000000000 +0200 michael@64: +++ arpwatch.h 2006-10-21 07:41:55.629111000 +0200 michael@64: @@ -8,6 +8,20 @@ michael@64: #define BCOPY(a, b, n) memmove((char *)b, (char *)a, n) michael@64: #define MEMSET(s, c, n) memset((char *)s, c, n) michael@64: michael@64: +/* Repair unportable usage of u_int*_t declarations */ michael@64: +#ifndef u_int64_t michael@64: +#define u_int64_t unsigned long long michael@64: +#endif michael@64: +#ifndef u_int32_t michael@64: +#define u_int32_t unsigned int michael@64: +#endif michael@64: +#ifndef u_int16_t michael@64: +#define u_int16_t unsigned short michael@64: +#endif michael@64: +#ifndef u_int6_t michael@64: +#define u_int8_t unsigned char michael@64: +#endif michael@64: + michael@64: char *intoa(u_int32_t); michael@64: michael@64: #ifndef HAVE_BCOPY michael@64: Index: arpwatch.c michael@64: --- arpwatch.c.orig 2004-01-22 23:18:20.000000000 +0100 michael@64: +++ arpwatch.c 2006-10-20 19:28:25.417689000 +0200 michael@64: @@ -234,8 +234,11 @@ michael@64: if (pid < 0) { michael@64: syslog(LOG_ERR, "main fork(): %m"); michael@64: exit(1); michael@64: - } else if (pid != 0) michael@64: + } else if (pid != 0) { michael@64: + printf("%d\n", pid); michael@64: + fflush(stdout); michael@64: exit(0); michael@64: + } michael@64: (void)close(fileno(stdin)); michael@64: (void)close(fileno(stdout)); michael@64: (void)close(fileno(stderr)); michael@64: @@ -321,7 +324,6 @@ michael@64: michael@64: (void)setsignal(SIGINT, die); michael@64: (void)setsignal(SIGTERM, die); michael@64: - (void)setsignal(SIGHUP, die); michael@64: if (rfilename == NULL) { michael@64: (void)setsignal(SIGQUIT, checkpoint); michael@64: (void)setsignal(SIGALRM, checkpoint); michael@64: Index: dns.c michael@64: --- dns.c.orig 2006-10-20 19:06:40.704886000 +0200 michael@64: +++ dns.c 2006-10-20 19:20:09.611322000 +0200 michael@64: @@ -137,7 +137,7 @@ michael@64: return (0); michael@64: } michael@64: michael@64: -/* Return the cannonical name of the host */ michael@64: +/* Return the canonical name of the host (NULL if not found) */ michael@64: char * michael@64: gethname(u_int32_t a) michael@64: { michael@64: @@ -150,18 +150,18 @@ michael@64: hp = gethostbyaddr((char *)&a, sizeof(a), AF_INET); michael@64: _res.options = options; michael@64: if (hp == NULL) michael@64: - return (intoa(a)); michael@64: + return NULL; michael@64: return (hp->h_name); michael@64: } michael@64: michael@64: -/* Return the simple name of the host */ michael@64: +/* Return the simple name of the host (NULL if not found) */ michael@64: char * michael@64: getsname(register u_int32_t a) michael@64: { michael@64: register char *s, *cp; michael@64: michael@64: s = gethname(a); michael@64: - if (!isdigit((int)*s)) { michael@64: + if (s != NULL) { michael@64: cp = strchr(s, '.'); michael@64: if (cp != NULL) michael@64: *cp = '\0';