summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_carp.c
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/netinet/ip_carp.c
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/netinet/ip_carp.c')
-rw-r--r--sys/netinet/ip_carp.c7
1 files changed, 4 insertions, 3 deletions
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