Index | Thread | Search

From:
"James J. Lippard" <lippard-openbsd@discord.org>
Subject:
[UPDATE] net/arpwatch 2.1a15 -> 3.9
To:
ports@openbsd.org
Date:
Thu, 23 Jul 2026 08:55:06 -0700

Download raw body.

Thread
  • James J. Lippard:

    [UPDATE] net/arpwatch 2.1a15 -> 3.9

Resubmitted with better diff.
-- 
Jim Lippard        lippard-openbsd@discord.org       https://discord.org/
GPG Key ID: 0x99FD5CD6


Index: net/arpwatch/Makefile
===================================================================
RCS file: /cvs/ports/net/arpwatch/Makefile,v
retrieving revision 1.56
diff -u -p -u -p -r1.56 Makefile
--- net/arpwatch/Makefile	17 Dec 2023 15:27:32 -0000	1.56
+++ net/arpwatch/Makefile	23 Jul 2026 15:50:20 -0000
@@ -1,10 +1,9 @@
 COMMENT=	monitor arp & rarp requests
 
-DISTNAME=	arpwatch-2.1a15
-REVISION=	21
+DISTNAME=	arpwatch-3.9
 CATEGORIES=	net
 
-SITES=		ftp://ftp.ee.lbl.gov/
+SITES=		https://ee.lbl.gov/downloads/arpwatch/
 
 MAINTAINER=	Jasper Lievisse Adriaanse <jasper@openbsd.org>
 
@@ -16,6 +15,8 @@ WANTLIB=		c pcap
 CONFIGURE_STYLE=	gnu
 MAKE_FLAGS+=		ARPDIR=${LOCALSTATEDIR}/arpwatch
 
+CONFIGURE_ARGS+= --enable-zeropad
+
 # this provides an up-to-date pregenerated ethercodes.dat file
 RUN_DEPENDS=	net/arp-scan,-mac
 
@@ -27,7 +28,8 @@ pre-build:
 	${SUBST_CMD} ${WRKSRC}/arpsnmp.8 ${WRKSRC}/arpwatch.8
 
 do-install:
-	@sed -i 's,awk -f ,awk -f ${EXAMPLESDIR}/', ${WRKSRC}/massagevendor
+	@sed -i 's,awk -f ,awk -f ${EXAMPLESDIR}/', ${WRKSRC}/massagevendor-old
+	@sed -i 's,awk -f ,awk -f ${EXAMPLESDIR}/', ${WRKSRC}/massagevendor.py
 	${INSTALL_PROGRAM} ${WRKSRC}/arpwatch ${PREFIX}/sbin
 	${INSTALL_PROGRAM} ${WRKSRC}/arpsnmp ${PREFIX}/sbin
 	${INSTALL_MAN} ${WRKSRC}/arpwatch.8 ${PREFIX}/man/man8
@@ -36,6 +38,7 @@ do-install:
 	${INSTALL_DATA} ${WRKSRC}/*.awk ${EXAMPLESDIR}
 	@${INSTALL_DATA} /dev/null ${EXAMPLESDIR}/arp.dat
 	@${INSTALL_SCRIPT} ${WRKSRC}/arp2ethers ${EXAMPLESDIR}
-	@${INSTALL_SCRIPT} ${WRKSRC}/massagevendor ${EXAMPLESDIR}
+	@${INSTALL_SCRIPT} ${WRKSRC}/massagevendor-old ${EXAMPLESDIR}
+	@${INSTALL_SCRIPT} ${WRKSRC}/massagevendor.py ${EXAMPLESDIR}
 
 .include <bsd.port.mk>
Index: net/arpwatch/distinfo
===================================================================
RCS file: /cvs/ports/net/arpwatch/distinfo,v
retrieving revision 1.18
diff -u -p -u -p -r1.18 distinfo
--- net/arpwatch/distinfo	3 Nov 2015 15:51:24 -0000	1.18
+++ net/arpwatch/distinfo	23 Jul 2026 15:50:20 -0000
@@ -1,2 +1,3 @@
-SHA256 (arpwatch-2.1a15.tar.gz) = wd+XN+IIqWph+pLdrYP0tNm+ZviZLzyRfp7fSwX/WJg=
-SIZE (arpwatch-2.1a15.tar.gz) = 202729
+SHA256 (arpwatch-3.9.tar.gz) = 832d20a5a508d9694a84a17e2627de3b3aa8b42b19ebdd97e264c511168f6eb4
+SIZE (arpwatch-3.9.tar.gz) = 117466
+
Index: net/arpwatch/patches/patch-arpsnmp.8
===================================================================
RCS file: /cvs/ports/net/arpwatch/patches/patch-arpsnmp.8,v
retrieving revision 1.5
diff -u -p -u -p -r1.5 patch-arpsnmp.8
--- net/arpwatch/patches/patch-arpsnmp.8	17 Dec 2023 15:27:32 -0000	1.5
+++ net/arpwatch/patches/patch-arpsnmp.8	23 Jul 2026 15:50:20 -0000
@@ -1,12 +1,19 @@
 Index: arpsnmp.8
---- arpsnmp.8.orig
-+++ arpsnmp.8
-@@ -69,7 +69,7 @@ man page for details on the report messages generated 
- .na
- .nh
- .nf
--/usr/operator/arpwatch - default directory
-+${LOCALSTATEDIR}/arpwatch - default directory
- arp.dat - ethernet/ip address database
- ethercodes.dat - vendor ethernet block list
- .ad
+--- arpsnmp.8.in.orig	Sun Dec  1 12:01:07 2019
++++ arpsnmp.8.in	Fri Jun 26 09:27:53 2026
+@@ -77,7 +77,7 @@
+ flag is used to specify the
+ .B arpwatch
+ working directory. This defaults to
+-.Ar /usr/local/arpwatch .
++.Ar ${LOCALSTATEDIR}/arpwatch .
+ .Pp
+ The
+ .Fl f
+@@ -152,6 +152,3 @@
+ the
+ .Ar arp.dat
+ file.
+-.Pp
+-Attempts are made to suppress DECnet flip flops but they
+-aren't always successful.
Index: net/arpwatch/patches/patch-arpwatch.8
===================================================================
RCS file: /cvs/ports/net/arpwatch/patches/patch-arpwatch.8,v
retrieving revision 1.4
diff -u -p -u -p -r1.4 patch-arpwatch.8
--- net/arpwatch/patches/patch-arpwatch.8	17 Dec 2023 15:27:32 -0000	1.4
+++ net/arpwatch/patches/patch-arpwatch.8	23 Jul 2026 15:50:20 -0000
@@ -1,43 +1,80 @@
 Add -u flag, to drop privileges to that user given
 
 Index: arpwatch.8
---- arpwatch.8.orig
-+++ arpwatch.8
-@@ -43,6 +43,9 @@ arpwatch - keep track of ethernet/ip address pairings
- ]] [
- .B -r
- .I file
-+] [
-+.B -u
-+.I username
- ]
- .ad
- .SH DESCRIPTION
-@@ -94,6 +97,18 @@ of reading from the network. In this case,
- .B arpwatch
+--- arpwatch.8.in.orig	Sat Dec  2 17:48:53 2023
++++ arpwatch.8.in	Fri Jun 26 09:27:35 2026
+@@ -43,6 +43,7 @@
+ .Op Fl n Ar net[/width]
+ .Op Fl x Ar net[/width]
+ .Op Fl r Ar file
++.Op Fl u Ar username
+ .Sh DESCRIPTION
+ .Nm
+ keeps track of ethernet/ip address pairings. It syslogs activity
+@@ -78,7 +79,7 @@
+ flag is used to specify the
+ .Nm
+ working directory. This defaults to
+-.Ar /usr/local/arpwatch .
++.Ar ${LOCALSTATEDIR}/arpwatch .
+ .Pp
+ The
+ .Fl f
+@@ -134,6 +135,18 @@
+ .Nm
  does not fork.
- .LP
+ .Pp
 +The
-+.B -u
++.Fl u
 +flag instructs
-+.B arpwatch
++.Xr arpwatch
 +to drop root privileges and change the UID to
-+.I username
++.It Pa username
 +and GID to the primary group of
-+.I username .
++.It Pa username .
 +This is recommended for security reasons, but
-+.I username
++.It Pa username
 +has to have write access to the default directory.
-+.LP
++.Pp
  Note that an empty
- .I arp.dat
+ .Ar arp.dat
  file must be created before the first time you run
-@@ -152,7 +167,7 @@ addresses was a DECnet address.
- .na
- .nh
- .nf
--/usr/operator/arpwatch - default directory
-+${LOCALSTATEDIR}/arpwatch - default directory
- arp.dat - ethernet/ip address database
- ethercodes.dat - vendor ethernet block list
- .ad
+@@ -187,8 +200,6 @@
+ .It Ic "flip flop"
+ The ethernet address has changed from the most recently seen address to
+ the second most recently seen address.
+-(If either the old or new ethernet address is a DECnet address and it
+-is less than 24 hours, the email version of the report is suppressed.)
+ .TP
+ .It Ic "changed ethernet address"
+ The host switched to a new ethernet address.
+@@ -211,9 +222,6 @@
+ The ethernet address has changed from the most recently seen address to
+ the third (or greater) least recently seen address.
+ (This is similar to a flip flop.)
+-.It Ic "suppressed DECnet flip flop"
+-A "flip flop" report was suppressed because one of the two
+-addresses was a DECnet address.
+ .Sh SIGNALS
+ Normally
+ .Nm
+@@ -222,8 +230,8 @@
+ once every 15 minutes.
+ The SIGHUP signal causes it to update immediately.
+ .Sh FILES
+-.Bl -tag -width ".Pa /usr/local/arpwatch" -compact
+-.It Pa /usr/local/arpwatch
++.Bl -tag -width ".Pa ${LOCALSTATEDIR}/arpwatch" -compact
++.It Pa ${LOCALSTATEDIR}/arpwatch
+ default directory
+ .It Pa arp.dat
+ default ethernet/ip address database
+@@ -247,8 +255,5 @@
+ .Sh BUGS
+ Please send bug reports to
+ .Aq arpwatch@ee.lbl.gov .
+-.Pp
+-Attempts are made to suppress DECnet flip flops but they
+-aren't always successful.
+ .Pp
+ Most error messages are posted using syslog.
Index: net/arpwatch/patches/patch-arpwatch_c
===================================================================
RCS file: /cvs/ports/net/arpwatch/patches/patch-arpwatch_c,v
retrieving revision 1.3
diff -u -p -u -p -r1.3 patch-arpwatch_c
--- net/arpwatch/patches/patch-arpwatch_c	11 Mar 2022 19:45:45 -0000	1.3
+++ net/arpwatch/patches/patch-arpwatch_c	23 Jul 2026 15:50:20 -0000
@@ -1,11 +1,12 @@
 - Do not bail if the interface does not have an IP assigned.
 - time_t format string fixes
 - add -u flag, to drop privileges to that user
+- pledge and unveil
 
 Index: arpwatch.c
---- arpwatch.c.orig
-+++ arpwatch.c
-@@ -63,6 +63,9 @@ struct rtentry;
+--- arpwatch.c.orig	Sun Dec  3 11:10:05 2023
++++ arpwatch.c	Thu Jun 25 07:29:02 2026
+@@ -72,6 +72,9 @@
  #include <syslog.h>
  #include <unistd.h>
  
@@ -15,9 +16,9 @@ Index: arpwatch.c
  #include <pcap.h>
  
  #include "gnuc.h"
-@@ -141,6 +144,24 @@ int	sanity_ether(struct ether_header *, struct ether_a
- int	sanity_fddi(struct fddi_header *, struct ether_arp *, int);
- __dead	void usage(void) __attribute__((volatile));
+@@ -172,6 +175,24 @@
+ int	toskip(u_int32_t);
+ void	usage(void) __attribute__((noreturn));
  
 +void dropprivileges(const char* user)
 +{
@@ -40,25 +41,25 @@ Index: arpwatch.c
  int
  main(int argc, char **argv)
  {
-@@ -153,6 +174,7 @@ main(int argc, char **argv)
- 	register char *interface, *rfilename;
+@@ -183,6 +204,7 @@
+ 	char *interface, *rfilename;
  	struct bpf_program code;
  	char errbuf[PCAP_ERRBUF_SIZE];
 +	char* username = NULL;
  
  	if (argv[0] == NULL)
  		prog = "arpwatch";
-@@ -170,7 +192,7 @@ main(int argc, char **argv)
+@@ -200,7 +222,7 @@
  	interface = NULL;
  	rfilename = NULL;
  	pd = NULL;
--	while ((op = getopt(argc, argv, "df:i:n:Nr:")) != EOF)
-+	while ((op = getopt(argc, argv, "df:i:n:Nr:u:")) != EOF)
+-	while ((op = getopt(argc, argv, "CdD:Ff:i:n:NpP:qr:svw:W:x:zZ")) != EOF)
++	while ((op = getopt(argc, argv, "CdD:Ff:i:n:NpP:qr:u:svw:W:x:zZ")) != EOF)
  		switch (op) {
  
- 		case 'd':
-@@ -202,6 +224,19 @@ main(int argc, char **argv)
- 			rfilename = optarg;
+ 		case 'C':
+@@ -285,6 +307,19 @@
+ 			zeropad = 1;
  			break;
  
 +		case 'u':
@@ -77,23 +78,8 @@ Index: arpwatch.c
  		default:
  			usage();
  		}
-@@ -223,9 +258,11 @@ main(int argc, char **argv)
- 
- 		/* Determine network and netmask */
- 		if (pcap_lookupnet(interface, &net, &netmask, errbuf) < 0) {
--			(void)fprintf(stderr, "%s: bad interface %s: %s\n",
--			    prog, interface, errbuf);
--			exit(1);
-+			(void)fprintf(stderr,
-+			    "%s: WARNING: cannot determine net/mask: %s\n",
-+			    prog, errbuf);
-+			net = 0;
-+			netmask = 0;
+@@ -381,13 +416,32 @@
  		}
- 
- 		/* Drop into the background if not debugging */
-@@ -279,12 +316,16 @@ main(int argc, char **argv)
- #endif
  	}
  
 +	if ( username ) {
@@ -109,32 +95,65 @@ Index: arpwatch.c
 +		setuid(getuid());
 +	}
  
++       /* unveil */
++       /* r for /, x for sendmail, rwc for /tmp and arpdir, rw for /dev/null */
++        if (unveil ("/", "r") == -1)
++               lg(LOG_ERR, "unveil /");
++        if (unveil ("/tmp", "rwc") == -1)
++               lg(LOG_ERR, "unveil /tmp");
++        if (unveil ("/dev/null", "rw") == -1)
++               lg(LOG_ERR, "unveil /dev/null");
++        if (unveil ("/usr/sbin/sendmail", "x") == -1)
++               lg(LOG_ERR, "unveil /usr/sbin/sendmail");
++        if (unveil (arpdir, "rwc") == -1)
++               lg(LOG_ERR, "unveil %s", arpdir);
++        if (unveil(NULL, NULL) == -1)
++               lg(LOG_ERR, "unveil");
++
  	/* Must be ethernet or fddi */
  	linktype = pcap_datalink(pd);
-@@ -401,7 +442,7 @@ process_ether(register u_char *u, register const struc
+ 	if (linktype != DLT_EN10MB && linktype != DLT_FDDI) {
+@@ -405,6 +459,13 @@
+ 		lg(LOG_ERR, "pcap_setfilter: %s", pcap_geterr(pd));
+ 		exit(1);
+ 	}
++
++       /* pledge not used earlier because prior need of pcap_filter BIOCSETF, not in bpf promise */
++       if (pledge ("stdio rpath wpath cpath inet dns proc exec tty bpf", NULL) == -1) {
++	        lg(LOG_ERR, "pledge: %s", strerror(errno));
++                exit(1);
++       }
++
+ 	if (rfilename == NULL)
+ 		lg(LOG_INFO, "listening on %s", interface);
+ 
+@@ -513,8 +574,8 @@
  	t = h->ts.tv_sec;
  	can_checkpoint = 0;
  	if (!ent_add(sia, sea, t, NULL))
--		syslog(LOG_ERR, "ent_add(%s, %s, %ld) failed",
-+		syslog(LOG_ERR, "ent_add(%s, %s, %lld) failed",
- 		    intoa(sia), e2str(sea), t);
+-		lg(LOG_ERR, "ent_add(%s, %s, %ld) failed",
+-		    intoa(sia), e2str(sea), (u_long)t);
++		lg(LOG_ERR, "ent_add(%s, %s, %lld) failed",
++		    intoa(sia), e2str(sea), t);
  	can_checkpoint = 1;
- }
-@@ -550,7 +591,7 @@ process_fddi(register u_char *u, register const struct
+ 
+ 	if (docheckpoint) {
+@@ -673,8 +734,8 @@
  	t = h->ts.tv_sec;
  	can_checkpoint = 0;
  	if (!ent_add(sia, sea, t, NULL))
--		syslog(LOG_ERR, "ent_add(%s, %s, %ld) failed",
-+		syslog(LOG_ERR, "ent_add(%s, %s, %lld) failed",
- 		    intoa(sia), e2str(sea), t);
+-		lg(LOG_ERR, "ent_add(%s, %s, %ld) failed",
+-		    intoa(sia), e2str(sea), (u_long)t);
++		lg(LOG_ERR, "ent_add(%s, %s, %lld) failed",
++		    intoa(sia), e2str(sea), t);
  	can_checkpoint = 1;
- }
-@@ -750,7 +791,7 @@ usage(void)
- 	extern char version[];
- 
- 	(void)fprintf(stderr, "Version %s\n", version);
--	(void)fprintf(stderr, "usage: %s [-dN] [-f datafile] [-i interface]"
-+	(void)fprintf(stderr, "usage: %s [-dN] [-f datafile] [-i interface] [-u username]"
- 	    " [-n net[/width]] [-r file]\n", prog);
+ 
+ 	if (docheckpoint) {
+@@ -944,6 +1005,6 @@
+ 	    "usage: %s [-CdFNpqsvzZ] [-D arpdir] [-f datafile]"
+ 	    " [-i interface]\n\t"
+ 	    " [-P pidfile] [-w watcher@email] [-W watchee@email]\n\t"
+-	    " [-n net[/width]] [-x net[/width]] [-r file]\n", prog);
++	    " [-n net[/width]] [-x net[/width]] [-r file] [-u username]\n", prog);
  	exit(1);
  }
Index: net/arpwatch/patches/patch-db_c
===================================================================
RCS file: /cvs/ports/net/arpwatch/patches/patch-db_c,v
retrieving revision 1.3
diff -u -p -u -p -r1.3 patch-db_c
--- net/arpwatch/patches/patch-db_c	11 Mar 2022 19:45:45 -0000	1.3
+++ net/arpwatch/patches/patch-db_c	23 Jul 2026 15:50:20 -0000
@@ -4,34 +4,35 @@ https://sources.debian.org/patches/arpwa
 remove DECnet remnants
 
 Index: db.c
---- db.c.orig
-+++ db.c
-@@ -95,6 +95,11 @@ ent_add(register u_int32_t a, register u_char *e, time
- 	u_char *e2;
+--- db.c.orig	2026-04-12 15:35:26
++++ db.c	2026-04-12 15:40:46
+@@ -108,6 +108,11 @@
  	time_t t2;
+ 	char *host;
  
 +	/* Ignore 0.0.0.0 */
 +	if (a == 0) {
-+		return(1);
++	        return(1);
 +	}
 +
  	/* Lookup ip address */
  	ap = ainfo_find(a);
  
-@@ -124,14 +129,11 @@ ent_add(register u_int32_t a, register u_char *e, time
- 		ep = ap->elist[1];
- 		if (MEMCMP(e, ep->e, 6) == 0) {
- 			/*
--			 * Suppress report when less than
--			 * FLIPFLOP_DELTA and one of the two ethernet
--			 * addresses is a DECnet logical.
-+			 * Suppress report when less than FLIPFLOP_DELTA.
+@@ -193,12 +198,11 @@
  			 */
  			t2 = ap->elist[0]->t;
  			e2 = ap->elist[0]->e;
 -			if (t - t2 < FLIPFLIP_DELTA &&
--			    (isdecnet(e) || isdecnet(e2)))
-+			if (t - t2 < FLIPFLIP_DELTA)
- 				dosyslog(LOG_INFO,
- 				    "suppressed DECnet flip flop", a, e, e2);
- 			else
+-			    (isdecnet(e) || isdecnet(e2))) {
+-				if (!quiet)
+-				    dosyslog(LOG_INFO,
+-					"suppressed DECnet flip flop",
+-					a, e, e2);
++			if (t - t2 < FLIPFLIP_DELTA) {
++			  if (!quiet)
++			    dosyslog(LOG_INFO,
++				     "suppressed flip flop",
++				     a, e, e2);
+ 			} else if (!suppress)
+ 				report("flip flop", a, e, e2, &t, &t2);
+ 			ap->elist[1] = ap->elist[0];
Index: net/arpwatch/patches/patch-ec_c
===================================================================
RCS file: /cvs/ports/net/arpwatch/patches/patch-ec_c,v
retrieving revision 1.3
diff -u -p -u -p -r1.3 patch-ec_c
--- net/arpwatch/patches/patch-ec_c	11 Mar 2022 19:45:45 -0000	1.3
+++ net/arpwatch/patches/patch-ec_c	23 Jul 2026 15:50:20 -0000
@@ -1,14 +1,14 @@
-zero-pad MAC address to match ifconfig(8) output
-https://sources.debian.org/patches/arpwatch/2.1a15-6/33_bug315215_zero-pad-MAC/
+[no longer needed: zero-pad MAC address to match ifconfig(8) output
+https://sources.debian.org/patches/arpwatch/2.1a15-6/33_bug315215_zero-pad-MAC/]
 
 remove DECnet remnants
 
 use a red-black tree instead of linked list for searching vendor IDs
 
 Index: ec.c
---- ec.c.orig
-+++ ec.c
-@@ -58,20 +58,28 @@ struct rtentry;
+--- ec.c.orig	Mon May 27 10:59:50 2024
++++ ec.c	Mon May 27 13:41:10 2024
+@@ -66,20 +66,28 @@
  #include "arpwatch.h"
  #include "ec.h"
  #include "util.h"
@@ -17,14 +17,14 @@ Index: ec.c
  /* Basic data structure */
 -struct ecent {
 +struct ecnode {
-+	RB_ENTRY(ecnode) entry;
++        RB_ENTRY(ecnode) entry;
  	u_int32_t o;		/* first 3 octets */
  	char *text;		/* associated text */
  };
  
 -static struct ecent *list;
--static u_int ec_last = 0;
--static u_int ec_len = 0;
+-static u_int ec_last;
+-static u_int ec_len;
 -
  /* Forwards */
 -static int ec_a2o(char *, u_int32_t *);
@@ -34,7 +34,7 @@ Index: ec.c
 +int
 +ocmp(struct ecnode *e1, struct ecnode *e2)
 +{
-+	return (e1->o < e2->o ? -1 : e1->o > e2->o);
++  return (e1->o < e2->o ? -1 : e1->o > e2->o ? 1 : 0);
 +}
 +
 +RB_HEAD(ectree, ecnode) head = RB_INITIALIZER(&head);
@@ -42,27 +42,32 @@ Index: ec.c
 +
  /* Convert an 3 octets from an ethernet address to a u_int32_t */
  static int
- ec_a2o(register char *cp, register u_int32_t *op)
-@@ -91,23 +99,18 @@ ec_a2o(register char *cp, register u_int32_t *op)
+ ec_a2o(char *cp, u_int32_t *op)
+@@ -99,28 +107,18 @@
  int
- ec_add(register u_int32_t o, register char *text)
+ ec_add(u_int32_t o, const char *text)
  {
-+	struct ecnode *n;
+-	struct ecent *olist;
++        struct ecnode *n;
  
 -	if (ec_last >= ec_len) {
 -		if (list == NULL) {
 -			ec_len = 512;
+-			olist = NULL;
 -			list = malloc(ec_len * sizeof(*list));
 -		} else {
 -			ec_len *= 2;
--			list = realloc(list, ec_len * sizeof(*list));
+-			olist = list;
+-			list = realloc(olist, ec_len * sizeof(*list));
 -		}
 -		if (list == NULL) {
--			syslog(LOG_ERR, "ec_add(): malloc: %m");
+-			if (olist != NULL)
+-				free(olist);
+-			lg(LOG_ERR, "ec_add(): malloc: %s", strerror(errno));
 -			exit(1);
 -		}
 +	if ((n = malloc(sizeof(struct ecnode))) == NULL) {
-+		syslog(LOG_ERR, "%s: malloc\n", __func__);
++	        syslog(LOG_ERR, "%s: malloc\n", __func__);
 +		return (0);
  	}
 -	list[ec_last].o = o;
@@ -73,21 +78,21 @@ Index: ec.c
 +	n->text = savestr(text);
 +
 +	RB_INSERT(ectree, &head, n);
-+
++	
  	return (1);
  }
  
-@@ -115,16 +118,16 @@ ec_add(register u_int32_t o, register char *text)
+@@ -128,16 +126,16 @@
  char *
- ec_find(register u_char *e)
+ ec_find(const u_char *e)
  {
 -	u_int32_t o;
--	register int i;
-+	struct ecnode find, *res;
+-	int i;
++        struct ecnode find, *res;
 +	u_int32_t o = 0;
  
 -	o = 0;
- 	BCOPY(e, &o, 3);
+ 	memmove(&o, e, 3);
 -	for (i = 0; i < ec_last; ++i)
 -		if (list[i].o == o)
 -			return (list[i].text);
@@ -96,36 +101,26 @@ Index: ec.c
 +	find.o = o;
 +	res = RB_FIND(ectree, &head, &find);
 +	if (res == NULL)
-+		return (NULL);
++	        return (NULL);
 +	else
-+		return res->text;
++	        return res->text;
  }
  
  /* Loop through the ethernet code database */
-@@ -182,17 +185,6 @@ ec_loop(register FILE *f, ec_process fn, register cons
- 	return (1);
- }
+@@ -193,16 +191,6 @@
+ 	}
  
+ 	return (1);
+-}
+-
 -/* DECnet local logical address prefix */
 -static u_char decnet[3] = { 0xaa, 0x0, 0x4 };
 -
 -/* Returns true if an ethernet address is decnet, else false */
 -int
--isdecnet(register u_char *e)
+-isdecnet(const u_char *e)
 -{
--
--	return (MEMCMP(e, decnet, sizeof(decnet)) == 0);
--}
--
- /* Convert an ascii ethernet string to ethernet address */
- int
- str2e(register char *str, register u_char *e)
-@@ -218,7 +210,7 @@ e2str(register u_char *e)
- {
- 	static char str[32];
- 
--	(void)sprintf(str, "%x:%x:%x:%x:%x:%x",
-+	(void)sprintf(str, "%02x:%02x:%02x:%02x:%02x:%02x",
- 	    e[0], e[1], e[2], e[3], e[4], e[5]);
- 	return (str);
+-	return (memcmp(e, decnet, sizeof(decnet)) == 0);
  }
+ 
+ /* Convert an ascii ethernet string to ethernet address */
Index: net/arpwatch/patches/patch-report_c
===================================================================
RCS file: net/arpwatch/patches/patch-report_c
diff -N net/arpwatch/patches/patch-report_c
--- net/arpwatch/patches/patch-report_c	11 Mar 2022 19:45:45 -0000	1.3
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,16 +0,0 @@
-Index: report.c
---- report.c.orig
-+++ report.c
-@@ -343,6 +343,12 @@ report(register char *title, register u_int32_t a, reg
- 		syslog(LOG_ERR, "dup2: %m");
- 		exit(1);
- 	}
-+
-+	if (freopen("/dev/null", "w", stderr) == NULL) {
-+		syslog(LOG_ERR, "freopen: %m");
-+		exit(1);
-+	}
-+
- 	/* XXX Need to freopen()? */
- 	/* Always Deliver interactively (pause when child depth gets large) */
- 	execl(sendmail, "sendmail", "-odi", watcher, NULL);
Index: net/arpwatch/pkg/PLIST
===================================================================
RCS file: /cvs/ports/net/arpwatch/pkg/PLIST,v
retrieving revision 1.15
diff -u -p -u -p -r1.15 PLIST
--- net/arpwatch/pkg/PLIST	28 Nov 2023 06:29:22 -0000	1.15
+++ net/arpwatch/pkg/PLIST	23 Jul 2026 15:50:20 -0000
@@ -19,6 +19,7 @@ share/examples/arpwatch/d.awk
 share/examples/arpwatch/duplicates.awk
 share/examples/arpwatch/e.awk
 share/examples/arpwatch/euppertolower.awk
-share/examples/arpwatch/massagevendor
+share/examples/arpwatch/massagevendor-old
+share/examples/arpwatch/massagevendor.py
 share/examples/arpwatch/p.awk
 @rcscript ${RCDIR}/arpwatch