summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/nd6_nbr.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet6/nd6_nbr.c')
-rw-r--r--sys/netinet6/nd6_nbr.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c
index a50925b..eca85eb 100644
--- a/sys/netinet6/nd6_nbr.c
+++ b/sys/netinet6/nd6_nbr.c
@@ -35,7 +35,6 @@ __FBSDID("$FreeBSD$");
#include "opt_inet.h"
#include "opt_inet6.h"
#include "opt_ipsec.h"
-#include "opt_carp.h"
#include "opt_mpath.h"
#include <sys/param.h>
@@ -74,10 +73,6 @@ __FBSDID("$FreeBSD$");
#include <netinet6/nd6.h>
#include <netinet/icmp6.h>
-#ifdef DEV_CARP
-#include <netinet/ip_carp.h>
-#endif
-
#define SDL(s) ((struct sockaddr_dl *)s)
struct dadq;
@@ -89,6 +84,10 @@ static void nd6_dad_ns_output(struct dadq *, struct ifaddr *);
static void nd6_dad_ns_input(struct ifaddr *);
static void nd6_dad_na_input(struct ifaddr *);
+struct ifaddr *(*carp_iamatch6_p)(struct ifnet *, struct in6_addr *);
+caddr_t (*carp_macmatch6_p)(struct ifnet *, struct mbuf *,
+ const struct in6_addr *);
+
VNET_DEFINE(int, dad_ignore_ns) = 0; /* ignore NS in DAD - specwise incorrect*/
VNET_DEFINE(int, dad_maxtry) = 15; /* max # of *tries* to transmit DAD packet */
#define V_dad_ignore_ns VNET(dad_ignore_ns)
@@ -222,14 +221,10 @@ nd6_ns_input(struct mbuf *m, int off, int icmp6len)
* (3) "tentative" address on which DAD is being performed.
*/
/* (1) and (3) check. */
-#ifdef DEV_CARP
if (ifp->if_carp)
- ifa = carp_iamatch6(ifp->if_carp, &taddr6);
+ ifa = (*carp_iamatch6_p)(ifp, &taddr6);
if (ifa == NULL)
ifa = (struct ifaddr *)in6ifa_ifpwithaddr(ifp, &taddr6);
-#else
- ifa = (struct ifaddr *)in6ifa_ifpwithaddr(ifp, &taddr6);
-#endif
/* (2) check. */
if (ifa == NULL) {
@@ -1029,14 +1024,10 @@ nd6_na_output(struct ifnet *ifp, const struct in6_addr *daddr6_0,
* my address) use lladdr configured for the interface.
*/
if (sdl0 == NULL) {
-#ifdef DEV_CARP
if (ifp->if_carp)
- mac = carp_macmatch6(ifp->if_carp, m, taddr6);
+ mac = (*carp_macmatch6_p)(ifp, m, taddr6);
if (mac == NULL)
mac = nd6_ifptomac(ifp);
-#else
- mac = nd6_ifptomac(ifp);
-#endif
} else if (sdl0->sa_family == AF_LINK) {
struct sockaddr_dl *sdl;
sdl = (struct sockaddr_dl *)sdl0;
OpenPOWER on IntegriCloud