pkgsrc/net/arpwatch/patches/patch-ae
bouyer c37f18c092 Add a '-a' flag, wich prevents arp traffic from being matched against the local
net before processing. Usefull if you don't want to have an IP addr on the
listening interface, or if you have aliases in different nets.
While I'm there correct a bogon in the man page.
2000-06-09 09:06:55 +00:00

53 lines
1.2 KiB
Text

$NetBSD: patch-ae,v 1.1 2000/06/09 09:06:56 bouyer Exp $
--- arpwatch.c.orig Fri Jun 9 09:51:11 2000
+++ arpwatch.c Fri Jun 9 09:54:14 2000
@@ -119,6 +119,7 @@
extern int optind;
extern int opterr;
extern char *optarg;
+int aflag = 0;
int
main(int argc, char **argv)
@@ -147,9 +148,12 @@
interface = NULL;
rfilename = NULL;
pd = NULL;
- while ((op = getopt(argc, argv, "df:i:r:")) != EOF)
+ while ((op = getopt(argc, argv, "adf:i:r:")) != EOF)
switch (op) {
+ case 'a':
+ aflag++;
+ break;
case 'd':
++debug;
#ifndef DEBUG
@@ -340,7 +344,7 @@
BCOPY(SPA(ea), &sia, 4);
/* Watch for bogons */
- if ((sia & netmask) != net) {
+ if (aflag == 0 && (sia & netmask) != net) {
dosyslog(LOG_INFO, "bogon", sia, sea, sha);
return;
}
@@ -489,7 +493,7 @@
BCOPY(SPA(ea), &sia, 4);
/* Watch for bogons */
- if ((sia & netmask) != net) {
+ if (aflag == 0 && (sia & netmask) != net) {
dosyslog(LOG_INFO, "bogon", sia, sea, sha);
return;
}
@@ -623,6 +627,7 @@
(void)fprintf(stderr, "Version %s\n", version);
(void)fprintf(stderr,
- "usage: %s [-d] [-f datafile] [-i interface] [-r file]\n", prog);
+ "usage: %s [-a] [-d] [-f datafile] [-i interface] [-r file]\n",
+ prog);
exit(1);
}