svn commit: r211193 - in head/sys: net netinet netinet6

Will Andrews will at FreeBSD.org
Wed Aug 11 20:18:19 UTC 2010


Author: will
Date: Wed Aug 11 20:18:19 2010
New Revision: 211193
URL: http://svn.freebsd.org/changeset/base/211193

Log:
  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)

Modified:
  head/sys/net/if.c
  head/sys/net/if_bridge.c
  head/sys/net/if_ethersubr.c
  head/sys/netinet/if_ether.c
  head/sys/netinet/ip_carp.c
  head/sys/netinet/ip_carp.h
  head/sys/netinet6/nd6_nbr.c

Modified: head/sys/net/if.c
==============================================================================
--- head/sys/net/if.c	Wed Aug 11 19:59:31 2010	(r211192)
+++ head/sys/net/if.c	Wed Aug 11 20:18:19 2010	(r211193)
@@ -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, "ifn
 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;
 

Modified: head/sys/net/if_bridge.c
==============================================================================
--- head/sys/net/if_bridge.c	Wed Aug 11 19:59:31 2010	(r211192)
+++ head/sys/net/if_bridge.c	Wed Aug 11 20:18:19 2010	(r211193)
@@ -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 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)

Modified: head/sys/net/if_ethersubr.c
==============================================================================
--- head/sys/net/if_ethersubr.c	Wed Aug 11 19:59:31 2010	(r211192)
+++ head/sys/net/if_ethersubr.c	Wed Aug 11 20:18:19 2010	(r211193)
@@ -114,11 +114,6 @@ void	(*ng_ether_attach_p)(struct ifnet *
 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 *); 

Modified: head/sys/netinet/if_ether.c
==============================================================================
--- head/sys/netinet/if_ether.c	Wed Aug 11 19:59:31 2010	(r211192)
+++ head/sys/netinet/if_ether.c	Wed Aug 11 20:18:19 2010	(r211193)
@@ -64,6 +64,9 @@ __FBSDID("$FreeBSD$");
 #include <netinet/in_var.h>
 #include <net/if_llatbl.h>
 #include <netinet/if_ether.h>
+#if defined(INET) || defined(INET6)
+#include <netinet/ip_carp.h>
+#endif
 
 #include <net/if_arc.h>
 #include <net/iso88025.h>
@@ -118,10 +121,6 @@ static void	arptimer(void *);
 #ifdef INET
 static void	in_arpinput(struct mbuf *);
 #endif
-#if defined(INET) || defined(INET6)
-int		(*carp_iamatch_p)(struct ifnet *, struct in_ifaddr *, struct in_addr *,
-		    u_int8_t **);
-#endif
 
 static const struct netisr_handler arp_nh = {
 	.nh_name = "arp",

Modified: head/sys/netinet/ip_carp.c
==============================================================================
--- head/sys/netinet/ip_carp.c	Wed Aug 11 19:59:31 2010	(r211192)
+++ head/sys/netinet/ip_carp.c	Wed Aug 11 20:18:19 2010	(r211193)
@@ -135,26 +135,6 @@ struct carp_softc {
 };
 #define	SC2IFP(sc)	((sc)->sc_ifp)
 
-/* These are external networking stack hooks for CARP */
-/* net/if.c */
-extern void (*carp_linkstate_p)(struct ifnet *);
-/* net/if_bridge.c net/if_ethersubr.c */
-extern struct ifnet *(*carp_forus_p)(struct ifnet *, u_char *);
-/* net/if_ethersubr.c */
-extern int (*carp_output_p)(struct ifnet *, struct mbuf *,
-    struct sockaddr *, struct rtentry *);
-#ifdef INET
-/* netinet/if_ether.c */
-extern int (*carp_iamatch_p)(struct ifnet *, struct in_ifaddr *,
-    struct in_addr *, u_int8_t **);
-#endif
-#ifdef INET6
-/* netinet6/nd6_nbr.c */
-extern struct ifaddr *(*carp_iamatch6_p)(struct ifnet *, struct in6_addr *);
-extern caddr_t (*carp_macmatch6_p)(struct ifnet *, struct mbuf *,
-    const struct in6_addr *);
-#endif
-
 int carp_suppress_preempt = 0;
 int carp_opts[CARPCTL_MAXID] = { 0, 1, 0, 1, 0, 0 };	/* XXX for now */
 SYSCTL_NODE(_net_inet, IPPROTO_CARP,	carp,	CTLFLAG_RW, 0,	"CARP");

Modified: head/sys/netinet/ip_carp.h
==============================================================================
--- head/sys/netinet/ip_carp.h	Wed Aug 11 19:59:31 2010	(r211192)
+++ head/sys/netinet/ip_carp.h	Wed Aug 11 20:18:19 2010	(r211193)
@@ -167,5 +167,25 @@ int		 carp_iamatch (struct ifnet *, stru
 struct ifaddr	*carp_iamatch6(struct ifnet *, struct in6_addr *);
 caddr_t		carp_macmatch6(struct ifnet *, struct mbuf *, const struct in6_addr *);
 struct	ifnet	*carp_forus (struct ifnet *, u_char *);
+
+/* These are external networking stack hooks for CARP */
+/* net/if.c */
+extern void (*carp_linkstate_p)(struct ifnet *);
+/* net/if_bridge.c net/if_ethersubr.c */
+extern struct ifnet *(*carp_forus_p)(struct ifnet *, u_char *);
+/* net/if_ethersubr.c */
+extern int (*carp_output_p)(struct ifnet *, struct mbuf *,
+    struct sockaddr *, struct rtentry *);
+#ifdef INET
+/* netinet/if_ether.c */
+extern int (*carp_iamatch_p)(struct ifnet *, struct in_ifaddr *,
+    struct in_addr *, u_int8_t **);
+#endif
+#ifdef INET6
+/* netinet6/nd6_nbr.c */
+extern struct ifaddr *(*carp_iamatch6_p)(struct ifnet *, struct in6_addr *);
+extern caddr_t (*carp_macmatch6_p)(struct ifnet *, struct mbuf *,
+    const struct in6_addr *);
+#endif
 #endif
 #endif /* _IP_CARP_H */

Modified: head/sys/netinet6/nd6_nbr.c
==============================================================================
--- head/sys/netinet6/nd6_nbr.c	Wed Aug 11 19:59:31 2010	(r211192)
+++ head/sys/netinet6/nd6_nbr.c	Wed Aug 11 20:18:19 2010	(r211193)
@@ -72,6 +72,7 @@ __FBSDID("$FreeBSD$");
 #include <netinet6/scope6_var.h>
 #include <netinet6/nd6.h>
 #include <netinet/icmp6.h>
+#include <netinet/ip_carp.h>
 
 #define SDL(s) ((struct sockaddr_dl *)s)
 
@@ -84,10 +85,6 @@ static void nd6_dad_ns_output(struct dad
 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)


More information about the svn-src-all mailing list