From owner-svn-src-all@FreeBSD.ORG Wed Aug 11 20:18:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA110106566B; Wed, 11 Aug 2010 20:18:19 +0000 (UTC) (envelope-from will@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 979CB8FC19; Wed, 11 Aug 2010 20:18:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7BKIJ9u061971; Wed, 11 Aug 2010 20:18:19 GMT (envelope-from will@svn.freebsd.org) Received: (from will@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7BKIJFO061963; Wed, 11 Aug 2010 20:18:19 GMT (envelope-from will@svn.freebsd.org) Message-Id: <201008112018.o7BKIJFO061963@svn.freebsd.org> From: Will Andrews Date: Wed, 11 Aug 2010 20:18:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211193 - in head/sys: net netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Aug 2010 20:18:19 -0000 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 #include +#include #ifdef INET6 #include #include @@ -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 #include #include +#if defined(INET) || defined(INET6) +#include +#endif #include #include @@ -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 #include #include +#include #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)