summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorRyan Thomas McBride <mcbride@cvs.openbsd.org>2003-11-07 22:04:47 +0000
committerRyan Thomas McBride <mcbride@cvs.openbsd.org>2003-11-07 22:04:47 +0000
commit7657cd694ab6e17f5f2c478e49f2a8c33c9f06bb (patch)
tree3f4e62ebf129c6324a17a98f9b264efa62d63365 /sys
parent0066c3fa61b681ec2c8be17f128dd86274508fea (diff)
Clean up carp_iamatch() behaviour so we don't reply to arp requests when
the interface is ifconfig'd down. Patch from Marco Pfatschbacher
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet/if_ether.c4
-rw-r--r--sys/netinet/ip_carp.c7
2 files changed, 5 insertions, 6 deletions
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c
index a165e998e5b..d7550afff72 100644
--- a/sys/netinet/if_ether.c
+++ b/sys/netinet/if_ether.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ether.c,v 1.50 2003/10/17 21:04:58 mcbride Exp $ */
+/* $OpenBSD: if_ether.c,v 1.51 2003/11/07 22:04:46 mcbride Exp $ */
/* $NetBSD: if_ether.c,v 1.31 1996/05/11 12:59:58 mycroft Exp $ */
/*
@@ -561,8 +561,6 @@ in_arpinput(m)
if (carp_iamatch(ac->ac_if.if_carp, ia,
&isaddr, &enaddr))
break;
- else
- goto out;
}
#endif
}
diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c
index a734d852ccd..87884baa943 100644
--- a/sys/netinet/ip_carp.c
+++ b/sys/netinet/ip_carp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_carp.c,v 1.23 2003/11/07 21:32:47 mcbride Exp $ */
+/* $OpenBSD: ip_carp.c,v 1.24 2003/11/07 22:04:46 mcbride Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff. All rights reserved.
@@ -861,7 +861,7 @@ carp_iamatch(void *v, struct in_ifaddr *ia,
}
if (count == 0) {
/* should never reach this */
- return (1);
+ return (0);
}
/* this should be a hash, like pf_hash() */
index = isaddr->s_addr % count;
@@ -889,11 +889,12 @@ carp_iamatch(void *v, struct in_ifaddr *ia,
(IFF_UP|IFF_RUNNING) && ia->ia_ifp ==
&vh->sc_ac.ac_if) {
*enaddr = vh->sc_ac.ac_enaddr;
+ return (1);
}
}
}
- return (1);
+ return (0);
}
#ifdef INET6