From owner-svn-src-all@FreeBSD.ORG Thu Jun 11 10:26:39 2009 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 624B9106566C; Thu, 11 Jun 2009 10:26:39 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 503228FC15; Thu, 11 Jun 2009 10:26:39 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5BAQdPT044319; Thu, 11 Jun 2009 10:26:39 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5BAQdOi044315; Thu, 11 Jun 2009 10:26:39 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <200906111026.n5BAQdOi044315@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Thu, 11 Jun 2009 10:26:39 +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: r193983 - in head/sys: conf net 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: Thu, 11 Jun 2009 10:26:39 -0000 Author: bz Date: Thu Jun 11 10:26:38 2009 New Revision: 193983 URL: http://svn.freebsd.org/changeset/base/193983 Log: carp(4) allows people to share a set of IP addresses and can only use IPv4/v6 for inter-node communication (according to my reading). Properly wrap the carp callouts in INET || INET6 and refelect this in sys/conf/files as well. While in theory this should be ok, it might be a bit optimistic to think that carp could build with inet6 only[1]. Discussed with: mlaier [1] Modified: head/sys/conf/files head/sys/net/if.c head/sys/net/if_bridge.c head/sys/net/if_ethersubr.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Jun 11 09:59:47 2009 (r193982) +++ head/sys/conf/files Thu Jun 11 10:26:38 2009 (r193983) @@ -2352,7 +2352,7 @@ netinet/if_atm.c optional atm netinet/if_ether.c optional ether netinet/igmp.c optional inet netinet/in.c optional inet -netinet/ip_carp.c optional carp +netinet/ip_carp.c optional inet carp | inet6 carp netinet/in_gif.c optional gif inet netinet/ip_gre.c optional gre inet netinet/ip_id.c optional inet Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Thu Jun 11 09:59:47 2009 (r193982) +++ head/sys/net/if.c Thu Jun 11 10:26:38 2009 (r193983) @@ -86,9 +86,11 @@ #include #include #endif +#if defined(INET) || defined(INET6) #ifdef DEV_CARP #include #endif +#endif #include @@ -1738,10 +1740,12 @@ if_unroute(struct ifnet *ifp, int flag, pfctlinput(PRC_IFDOWN, ifa->ifa_addr); ifp->if_qflush(ifp); +#if defined(INET) || defined(INET6) #ifdef DEV_CARP if (ifp->if_carp) carp_carpdev_state(ifp->if_carp); #endif +#endif rt_ifmsg(ifp); } @@ -1762,10 +1766,12 @@ if_route(struct ifnet *ifp, int flag, in TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) if (fam == PF_UNSPEC || (fam == ifa->ifa_addr->sa_family)) pfctlinput(PRC_IFUP, ifa->ifa_addr); +#if defined(INET) || defined(INET6) #ifdef DEV_CARP if (ifp->if_carp) carp_carpdev_state(ifp->if_carp); #endif +#endif rt_ifmsg(ifp); #ifdef INET6 in6_if_up(ifp); @@ -1816,10 +1822,12 @@ do_link_state_change(void *arg, int pend if ((ifp->if_type == IFT_ETHER || ifp->if_type == IFT_L2VLAN) && IFP2AC(ifp)->ac_netgraph != NULL) (*ng_ether_link_state_p)(ifp, link_state); +#if defined(INET) || defined(INET6) #ifdef DEV_CARP if (ifp->if_carp) carp_carpdev_state(ifp->if_carp); #endif +#endif if (ifp->if_bridge) { KASSERT(bstp_linkstate_p != NULL,("if_bridge bstp not loaded!")); (*bstp_linkstate_p)(ifp, link_state); Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Thu Jun 11 09:59:47 2009 (r193982) +++ head/sys/net/if_bridge.c Thu Jun 11 10:26:38 2009 (r193983) @@ -122,9 +122,11 @@ __FBSDID("$FreeBSD$"); #include #include #endif +#if defined(INET) || defined(INET6) #ifdef DEV_CARP #include #endif +#endif #include #include /* for struct arpcom */ #include @@ -2231,7 +2233,7 @@ bridge_input(struct ifnet *ifp, struct m return (m); } -#ifdef DEV_CARP +#if (defined(INET) || defined(INET6)) && defined(DEV_CARP) # define OR_CARP_CHECK_WE_ARE_DST(iface) \ || ((iface)->if_carp \ && carp_forus((iface)->if_carp, eh->ether_dhost)) Modified: head/sys/net/if_ethersubr.c ============================================================================== --- head/sys/net/if_ethersubr.c Thu Jun 11 09:59:47 2009 (r193982) +++ head/sys/net/if_ethersubr.c Thu Jun 11 10:26:38 2009 (r193983) @@ -79,9 +79,11 @@ #include #endif +#if defined(INET) || defined(INET6) #ifdef DEV_CARP #include #endif +#endif #ifdef IPX #include @@ -393,11 +395,13 @@ ether_output(struct ifnet *ifp, struct m return (error); } +#if defined(INET) || defined(INET6) #ifdef DEV_CARP if (ifp->if_carp && (error = carp_output(ifp, m, dst, NULL))) goto bad; #endif +#endif /* Handle ng_ether(4) processing, if any */ if (IFP2AC(ifp)->ac_netgraph != NULL) { @@ -712,6 +716,7 @@ ether_input(struct ifnet *ifp, struct mb } } +#if defined(INET) || defined(INET6) #ifdef DEV_CARP /* * Clear M_PROMISC on frame so that carp(4) will see it when the @@ -727,6 +732,7 @@ ether_input(struct ifnet *ifp, struct mb m->m_flags &= ~M_PROMISC; } else #endif +#endif { /* * If the frame received was not for our MAC address, set the