summaryrefslogtreecommitdiff
path: root/sys/netinet6/nd6_nbr.c
diff options
context:
space:
mode:
authorMarco Pfatschbacher <mpf@cvs.openbsd.org>2007-03-18 23:23:18 +0000
committerMarco Pfatschbacher <mpf@cvs.openbsd.org>2007-03-18 23:23:18 +0000
commit6f9929b6c6550b6c1afc1f5a1a5e4e3ee079857f (patch)
tree7b53d8b777e07c5f80672a4209bba5256148b33e /sys/netinet6/nd6_nbr.c
parent1cddb68d501e88a56b636de082738e5483715814 (diff)
Add IP load balancing support for carp(4).
This provides a similar functionality as ARP balancing, but also works for traffic that comes across routers. IPv6 is supported as well. The configuration scheme will change as soon we have sth better. Also add support for changing the MAC address on carp(4) interfaces. (code from mcbride) Tested by pyr@ and reyk@ OK mcbride@
Diffstat (limited to 'sys/netinet6/nd6_nbr.c')
-rw-r--r--sys/netinet6/nd6_nbr.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c
index e3a1fe72926..a5f425eef0b 100644
--- a/sys/netinet6/nd6_nbr.c
+++ b/sys/netinet6/nd6_nbr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nd6_nbr.c,v 1.42 2006/11/17 01:11:23 itojun Exp $ */
+/* $OpenBSD: nd6_nbr.c,v 1.43 2007/03/18 23:23:17 mpf Exp $ */
/* $KAME: nd6_nbr.c,v 1.61 2001/02/10 16:06:14 jinmei Exp $ */
/*
@@ -193,10 +193,13 @@ nd6_ns_input(m, off, icmp6len)
*/
/* (1) and (3) check. */
#if NCARP > 0
- if (ifp->if_carp && ifp->if_type != IFT_CARP)
- ifa = carp_iamatch6(ifp->if_carp, &taddr6);
- if (!ifa)
+ if (ifp->if_type == IFT_CARP) {
ifa = (struct ifaddr *)in6ifa_ifpwithaddr(ifp, &taddr6);
+ if (ifa && !carp_iamatch6(ifp, ifa))
+ ifa = NULL;
+ } else {
+ ifa = (struct ifaddr *)in6ifa_ifpwithaddr(ifp, &taddr6);
+ }
#else
ifa = (struct ifaddr *)in6ifa_ifpwithaddr(ifp, &taddr6);
#endif