summaryrefslogtreecommitdiffstats
path: root/sys/net
diff options
context:
space:
mode:
authorwill <will@FreeBSD.org>2010-08-11 20:18:19 +0000
committerwill <will@FreeBSD.org>2010-08-11 20:18:19 +0000
commitd548943ae909fff2cc91f964186d557895e14bab (patch)
tree04a9bbb85e9f7f4a28b5bef19bf56f932ebf0ea4 /sys/net
parent9198b19835979cee1b431f818f01d9859c25f48f (diff)
downloadFreeBSD-src-d548943ae909fff2cc91f964186d557895e14bab.zip
FreeBSD-src-d548943ae909fff2cc91f964186d557895e14bab.tar.gz
Unbreak LINT by moving all carp hooks to net/if.c / netinet/ip_carp.h, with
the appropriate ifdefs. Reviewed by: bz Approved by: ken (mentor)
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if.c16
-rw-r--r--sys/net/if_bridge.c8
-rw-r--r--sys/net/if_ethersubr.c5
3 files changed, 18 insertions, 11 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 3c4ad16..c1c6ee9 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -80,6 +80,7 @@
/*XXX*/
#include <netinet/in.h>
#include <netinet/in_var.h>
+#include <netinet/ip_carp.h>
#ifdef INET6
#include <netinet6/in6_var.h>
#include <netinet6/in6_ifattach.h>
@@ -124,7 +125,22 @@ SX_SYSINIT(ifdescr_sx, &ifdescr_sx, "ifnet descr");
void (*bstp_linkstate_p)(struct ifnet *ifp, int state);
void (*ng_ether_link_state_p)(struct ifnet *ifp, int state);
void (*lagg_linkstate_p)(struct ifnet *ifp, int state);
+/* These are external hooks for CARP. */
void (*carp_linkstate_p)(struct ifnet *ifp);
+#if defined(INET) || defined(INET6)
+struct ifnet *(*carp_forus_p)(struct ifnet *ifp, u_char *dhost);
+int (*carp_output_p)(struct ifnet *ifp, struct mbuf *m,
+ struct sockaddr *sa, struct rtentry *rt);
+#endif
+#ifdef INET
+int (*carp_iamatch_p)(struct ifnet *, struct in_ifaddr *, struct in_addr *,
+ u_int8_t **);
+#endif
+#ifdef INET6
+struct ifaddr *(*carp_iamatch6_p)(struct ifnet *ifp, struct in6_addr *taddr6);
+caddr_t (*carp_macmatch6_p)(struct ifnet *ifp, struct mbuf *m,
+ const struct in6_addr *taddr);
+#endif
struct mbuf *(*tbr_dequeue_ptr)(struct ifaltq *, int) = NULL;
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c
index fb04731..5ac4ef0 100644
--- a/sys/net/if_bridge.c
+++ b/sys/net/if_bridge.c
@@ -2141,10 +2141,6 @@ drop:
m_freem(m);
}
-#if defined(INET) || defined(INET6)
-int (*carp_forus_p)(struct carp_if *, u_char *);
-#endif
-
/*
* bridge_input:
*
@@ -2256,10 +2252,10 @@ bridge_input(struct ifnet *ifp, struct mbuf *m)
#if (defined(INET) || defined(INET6))
# define OR_CARP_CHECK_WE_ARE_DST(iface) \
|| ((iface)->if_carp \
- && (*carp_forus_p)((iface)->if_carp, eh->ether_dhost))
+ && (*carp_forus_p)((iface), eh->ether_dhost))
# define OR_CARP_CHECK_WE_ARE_SRC(iface) \
|| ((iface)->if_carp \
- && (*carp_forus_p)((iface)->if_carp, eh->ether_shost))
+ && (*carp_forus_p)((iface), eh->ether_shost))
#else
# define OR_CARP_CHECK_WE_ARE_DST(iface)
# define OR_CARP_CHECK_WE_ARE_SRC(iface)
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
index 984d0bb..d284d11 100644
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -114,11 +114,6 @@ void (*ng_ether_attach_p)(struct ifnet *ifp);
void (*ng_ether_detach_p)(struct ifnet *ifp);
void (*vlan_input_p)(struct ifnet *, struct mbuf *);
-#if defined(INET) || defined(INET6)
-int (*carp_forus_p)(struct ifnet *, u_char *);
-int (*carp_output_p)(struct ifnet *, struct mbuf *, struct sockaddr *,
- struct rtentry *);
-#endif
/* if_bridge(4) support */
struct mbuf *(*bridge_input_p)(struct ifnet *, struct mbuf *);
OpenPOWER on IntegriCloud