diff options
author | nork <nork@FreeBSD.org> | 2006-04-20 15:01:18 +0000 |
---|---|---|
committer | nork <nork@FreeBSD.org> | 2006-04-20 15:01:18 +0000 |
commit | 47947688ca0ca2648583670c82d65b2640617ecd (patch) | |
tree | ad8ca469b49bc7dc16f8a4e412ce67b2adf39abd /net-mgmt | |
parent | 7edba94c353560ebecdcb841b79feffa330b2719 (diff) | |
download | FreeBSD-ports-47947688ca0ca2648583670c82d65b2640617ecd.zip FreeBSD-ports-47947688ca0ca2648583670c82d65b2640617ecd.tar.gz |
Don't send arp reply to sender if the arp request queries
the MAC address for the itself.
Submitted by: Vlad V Cheryomushkin <vladd@rekom.ru>
Diffstat (limited to 'net-mgmt')
-rw-r--r-- | net-mgmt/choparp/Makefile | 2 | ||||
-rw-r--r-- | net-mgmt/choparp/files/patch-choparp.c | 21 |
2 files changed, 17 insertions, 6 deletions
diff --git a/net-mgmt/choparp/Makefile b/net-mgmt/choparp/Makefile index 4935352..1e066df 100644 --- a/net-mgmt/choparp/Makefile +++ b/net-mgmt/choparp/Makefile @@ -7,7 +7,7 @@ PORTNAME= choparp PORTVERSION= 20021107 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= net-mgmt MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= choparp diff --git a/net-mgmt/choparp/files/patch-choparp.c b/net-mgmt/choparp/files/patch-choparp.c index 76c1970..eb0351c 100644 --- a/net-mgmt/choparp/files/patch-choparp.c +++ b/net-mgmt/choparp/files/patch-choparp.c @@ -1,5 +1,5 @@ --- choparp.c.orig Fri Nov 8 07:36:03 2002 -+++ choparp.c Sat Apr 8 14:37:41 2006 ++++ choparp.c Thu Apr 20 23:56:38 2006 @@ -42,6 +42,7 @@ #include <string.h> #include <sys/types.h> @@ -8,7 +8,18 @@ #include <sys/time.h> #include <sys/ioctl.h> #include <net/bpf.h> -@@ -280,13 +281,22 @@ +@@ -239,6 +240,10 @@ + fprintf(stderr,"checkarp: WARNING: received unknown type ARP request.\n"); + return(0); + } ++ if (ntohl(*(u_int32_t *)(arp->arp_tpa)) == ntohl(*(u_int32_t *)(arp->arp_spa))) { ++ fprintf(stderr,"checkarp: WARNING: sender equal dest.\n"); ++ return(0); ++ } + target_ip = ntohl(*(u_int32_t *)(arp->arp_tpa)); + return match(target_ip, targets) && !match(target_ip, excludes); + } +@@ -280,13 +285,22 @@ char *rframe; char *sframe; size_t frame_len; @@ -35,7 +46,7 @@ if (r < 0) { if (errno == EINTR) -@@ -295,7 +305,7 @@ +@@ -295,7 +309,7 @@ return; } @@ -44,7 +55,7 @@ if (rlen < 0) { if (errno == EINTR) continue; -@@ -307,7 +317,7 @@ +@@ -307,7 +321,7 @@ while((rframe = getarp(p, rlen, &nextp, &nextlen)) != NULL){ if (checkarp(rframe)){ sframe = gen_arpreply(rframe, &frame_len); @@ -53,7 +64,7 @@ } p = nextp; rlen = nextlen; -@@ -437,6 +447,9 @@ +@@ -437,6 +451,9 @@ #endif if ((fd = openbpf(ifname, &buf, &buflen)) < 0) return(-1); |