net-mgmt/arpwatch: some patches

- take maintainer
- add -z flag to not send mail for 0.0.0.0 IPs from busy dhcp networks
- makepatch conform patchfiles
This commit is contained in:
Kurt Jaeger 2016-03-28 09:50:27 +00:00
parent 30cb827613
commit f6d607e915
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=412035
11 changed files with 88 additions and 53 deletions

View file

@ -3,12 +3,12 @@
PORTNAME= arpwatch
DISTVERSION= 2.1a15
PORTREVISION= 8
PORTREVISION= 9
CATEGORIES= net-mgmt
MASTER_SITES= ftp://ftp.ee.lbl.gov/ \
GENTOO
MAINTAINER= ports@FreeBSD.org
MAINTAINER= pi@FreeBSD.org
COMMENT= Monitor arp & rarp requests
LICENSE= BSD3CLAUSE

View file

@ -1,6 +1,6 @@
--- Makefile.in.orig 2000-06-15 00:39:55 UTC
+++ Makefile.in
@@ -31,7 +31,7 @@
@@ -31,7 +31,7 @@ BINDEST = @sbindir@
# Pathname of directory to install the man page
MANDEST = @mandir@
# Pathname of directory to install database file
@ -9,7 +9,7 @@
# VPATH
srcdir = @srcdir@
@@ -45,7 +45,7 @@
@@ -45,7 +45,7 @@ CC = @CC@
PROG = arpwatch
CCOPT = @V_CCOPT@
INCLS = -I. @V_INCLS@
@ -18,7 +18,7 @@
# Standard CFLAGS
CFLAGS = $(CCOPT) $(DEFS) $(INCLS)
@@ -110,13 +110,13 @@
@@ -110,13 +110,13 @@ zap: zap.o intoa.o
$(CC) $(CFLAGS) -o $@ zap.o intoa.o -lutil
install: force

View file

@ -1,6 +1,6 @@
--- arpsnmp.8.orig Sun Sep 17 16:34:48 2000
+++ arpsnmp.8 Fri Jul 7 10:07:53 2006
@@ -30,6 +30,9 @@
--- arpsnmp.8.orig 2000-09-17 20:34:48 UTC
+++ arpsnmp.8
@@ -30,6 +30,9 @@ arpsnmp - keep track of ethernet/ip addr
] [
.B -f
.I datafile
@ -10,7 +10,7 @@
]
.I file
[
@@ -55,6 +58,12 @@
@@ -55,6 +58,12 @@ flag is used to set the ethernet/ip addr
The default is
.IR arp.dat .
.LP
@ -23,7 +23,7 @@
Note that an empty
.I arp.dat
file must be created before the first time you run
@@ -69,7 +78,7 @@
@@ -69,7 +78,7 @@ man page for details on the report messa
.na
.nh
.nf

View file

@ -1,6 +1,6 @@
--- arpsnmp.c.orig Mon Jan 18 01:47:40 1999
+++ arpsnmp.c Thu Feb 22 22:47:29 2001
@@ -68,6 +68,8 @@
--- arpsnmp.c.orig 2004-01-22 22:25:17 UTC
+++ arpsnmp.c
@@ -68,6 +68,8 @@ __dead void usage(void) __attribute__((v
char *prog;
@ -9,7 +9,7 @@
extern int optind;
extern int opterr;
extern char *optarg;
@@ -90,7 +92,7 @@
@@ -90,7 +92,7 @@ main(int argc, char **argv)
}
opterr = 0;
@ -18,7 +18,7 @@
switch (op) {
case 'd':
@@ -105,6 +107,10 @@
@@ -105,6 +107,10 @@ main(int argc, char **argv)
arpfile = optarg;
break;
@ -29,7 +29,7 @@
default:
usage();
}
@@ -184,6 +190,6 @@
@@ -185,6 +191,6 @@ usage(void)
(void)fprintf(stderr, "Version %s\n", version);
(void)fprintf(stderr,

View file

@ -1,6 +1,15 @@
--- arpwatch.8.orig Sun Oct 8 16:31:28 2000
+++ arpwatch.8 Fri Jul 7 10:03:53 2006
@@ -38,6 +38,9 @@
--- arpwatch.8.orig 2000-10-08 20:31:28 UTC
+++ arpwatch.8
@@ -27,7 +27,7 @@ arpwatch - keep track of ethernet/ip add
.na
.B arpwatch
[
-.B -dN
+.B -dNz
] [
.B -f
.I datafile
@@ -38,6 +38,9 @@ arpwatch - keep track of ethernet/ip add
.br
.ti +8
[
@ -10,7 +19,7 @@
.B -n
.IR net [/ width
]] [
@@ -71,6 +74,12 @@
@@ -71,6 +74,12 @@ The
flag is used to override the default interface.
.LP
The
@ -23,7 +32,18 @@
.B -n
flag specifies additional local networks. This can be useful to
avoid "bogon" warnings when there is more than one network running
@@ -152,7 +161,7 @@
@@ -83,6 +92,10 @@ The
flag disables reporting any bogons.
.LP
The
+.B -z
+flag disables reporting 0.0.0.0 changes, helpful in busy DHCP networks.
+.LP
+The
.B -r
flag is used to specify a savefile
(perhaps created by
@@ -152,7 +165,7 @@ addresses was a DECnet address.
.na
.nh
.nf

View file

@ -1,6 +1,6 @@
--- arpwatch.c.orig Thu Jan 22 17:18:20 2004
+++ arpwatch.c Thu Jul 20 12:30:08 2006
@@ -107,6 +107,8 @@
--- arpwatch.c.orig 2004-01-22 22:18:20 UTC
+++ arpwatch.c
@@ -107,6 +107,8 @@ struct rtentry;
char *prog;
@ -9,27 +9,30 @@
int can_checkpoint;
int swapped;
int nobogons;
@@ -170,7 +172,7 @@
@@ -170,7 +172,7 @@ main(int argc, char **argv)
interface = NULL;
rfilename = NULL;
pd = NULL;
- while ((op = getopt(argc, argv, "df:i:n:Nr:")) != EOF)
+ while ((op = getopt(argc, argv, "df:i:m:n:Nr:")) != EOF)
+ while ((op = getopt(argc, argv, "dzf:i:m:n:Nr:")) != EOF)
switch (op) {
case 'd':
@@ -202,6 +204,10 @@
@@ -202,6 +204,13 @@ main(int argc, char **argv)
rfilename = optarg;
break;
+ case 'm':
+ Watcher = optarg;
+ break;
+ case 'z':
+ zeroflag = 1;
+ break;
+
default:
usage();
}
@@ -321,7 +327,6 @@
@@ -321,7 +330,6 @@ main(int argc, char **argv)
(void)setsignal(SIGINT, die);
(void)setsignal(SIGTERM, die);
@ -37,7 +40,7 @@
if (rfilename == NULL) {
(void)setsignal(SIGQUIT, checkpoint);
(void)setsignal(SIGALRM, checkpoint);
@@ -751,6 +756,6 @@
@@ -751,6 +759,6 @@ usage(void)
(void)fprintf(stderr, "Version %s\n", version);
(void)fprintf(stderr, "usage: %s [-dN] [-f datafile] [-i interface]"

View file

@ -1,6 +1,6 @@
--- configure.orig Wed Jun 21 16:32:38 2006
+++ configure Fri Jul 7 09:57:50 2006
@@ -1419,7 +1419,7 @@
--- configure.orig 2006-06-21 20:32:38 UTC
+++ configure
@@ -1419,7 +1419,7 @@ if test "${with_gcc+set}" = set; then
withval="$with_gcc"
fi;
@ -9,7 +9,7 @@
V_INCLS=""
if test "${srcdir}" != "." ; then
V_INCLS="-I\$\(srcdir\)"
@@ -5299,7 +5299,7 @@
@@ -5299,7 +5299,7 @@ echo "${ECHO_T}$ac_cv_lbl_gcc_vers" >&6
fi
V_CCOPT="$V_CCOPT -Wall"
if test "$ac_cv_lbl_gcc_vers" -gt 1 ; then

View file

@ -1,6 +1,6 @@
--- db.c.orig Sat Sep 30 19:39:58 2000
+++ db.c Tue Apr 13 17:42:20 2004
@@ -283,7 +283,7 @@
--- db.c.orig 2000-09-30 23:39:58 UTC
+++ db.c
@@ -283,7 +283,7 @@ elist_alloc(register u_int32_t a, regist
BCOPY(e, ep->e, 6);
if (h == NULL && !initializing)
h = getsname(a);
@ -9,7 +9,7 @@
strcpy(ep->h, h);
ep->t = t;
return (ep);
@@ -301,7 +301,7 @@
@@ -301,7 +301,7 @@ check_hname(register struct ainfo *ap)
return;
ep = ap->elist[0];
h = getsname(ap->a);

View file

@ -1,15 +1,15 @@
--- dns.c.orig Fri Oct 13 21:50:52 2000
+++ dns.c Tue Apr 13 17:35:07 2004
@@ -137,7 +137,7 @@
--- dns.c.orig 2000-10-14 01:50:52 UTC
+++ dns.c
@@ -137,7 +137,7 @@ gethinfo(register char *hostname, regist
return (0);
}
-/* Return the cannonical name of the host */
+/* Return the canonical name of the host (NULL if not found) */
char *
gethname(u_int32_t a)
{
@@ -150,18 +150,18 @@
@@ -150,18 +150,18 @@ gethname(u_int32_t a)
hp = gethostbyaddr((char *)&a, sizeof(a), AF_INET);
_res.options = options;
if (hp == NULL)
@ -17,14 +17,14 @@
+ return NULL;
return (hp->h_name);
}
-/* Return the simple name of the host */
+/* Return the simple name of the host (NULL if not found) */
char *
getsname(register u_int32_t a)
{
register char *s, *cp;
s = gethname(a);
- if (!isdigit((int)*s)) {
+ if (s != NULL) {

View file

@ -1,6 +1,6 @@
--- report.c.orig Sat Sep 30 19:41:10 2000
+++ report.c Tue Apr 13 17:47:16 2004
@@ -45,6 +45,8 @@
--- report.c.orig 2000-09-30 23:41:10 UTC
+++ report.c
@@ -45,6 +45,8 @@ struct rtentry;
#include <ctype.h>
#include <errno.h>
@ -9,7 +9,7 @@
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
@@ -70,6 +72,8 @@
@@ -70,6 +72,8 @@ struct rtentry;
#define PLURAL(n) ((n) == 1 || (n) == -1 ? "" : "s")
@ -18,7 +18,7 @@
static int cdepth; /* number of outstanding children */
static char *fmtdate(time_t);
@@ -240,7 +244,7 @@
@@ -240,7 +244,7 @@ report(register char *title, register u_
register FILE *f;
char tempfile[64], cpu[64], os[64];
char *fmt = "%20s: %s\n";
@ -27,7 +27,19 @@
char *watchee = WATCHEE;
char *sendmail = PATH_SENDMAIL;
char *unknown = "<unknown>";
@@ -303,7 +307,7 @@
@@ -251,6 +255,11 @@ report(register char *title, register u_
if (initializing)
return;
+ /* No mail for 0.0.0.0 if -z */
+ if (zeroflag == 1 && strncmp("0.0.0.0",intoa(a),16) == 0 ) {
+ dosyslog(LOG_NOTICE, title, a, e1, e2);
+ return;
+ }
if (debug) {
if (debug > 1) {
dosyslog(LOG_NOTICE, title, a, e1, e2);
@@ -303,7 +312,7 @@ report(register char *title, register u_
(void)fprintf(f, "From: %s\n", watchee);
(void)fprintf(f, "To: %s\n", watcher);
hn = gethname(a);
@ -36,7 +48,7 @@
(void)fprintf(f, "Subject: %s (%s)\n", title, hn);
else {
(void)fprintf(f, "Subject: %s\n", title);
@@ -344,6 +348,25 @@
@@ -344,6 +353,25 @@ report(register char *title, register u_
exit(1);
}
/* XXX Need to freopen()? */

View file

@ -10,6 +10,6 @@ man/man8/arpsnmp.8.gz
man/man8/arpwatch.8.gz
sbin/arpsnmp
sbin/arpwatch
@unexec test -f %D/arpwatch/arp.dat && test -s %D/arpwatch/arp.dat || rm -f %D/arpwatch/arp.dat
@exec test -f %D/arpwatch/arp.dat || touch %D/arpwatch/arp.dat
@postexec test -f %D/arpwatch/arp.dat || touch %D/arpwatch/arp.dat
@preunexec test -f %D/arpwatch/arp.dat && test -s %D/arpwatch/arp.dat || rm -f %D/arpwatch/arp.dat
@dir(,operator,0755) arpwatch