svn commit: r310864 - head/sys/netinet

Ngie Cooper ngie at FreeBSD.org
Fri Dec 30 21:33:02 UTC 2016


Author: ngie
Date: Fri Dec 30 21:33:01 2016
New Revision: 310864
URL: https://svnweb.freebsd.org/changeset/base/310864

Log:
  Unbreak ip_carp with WITHOUT_INET6 enabled by conditionalizing all IPv6
  structs under the INET6 #ifdef. Similarly (even though it doesn't seem
  to affect the build), conditionalize all IPv4 structs under the INET
  #ifdef
  
  This also unbreaks the LINT-NOINET6 tinderbox target on amd64; I have not
  verified other MACHINE/TARGET pairs (e.g. armv6/arm).
  
  MFC after:	2 weeks
  X-MFC with:	r310847
  Pointyhat to:	jpaetzel
  Reported by:	O. Hartmann <o.hartmann at walstatt.org>

Modified:
  head/sys/netinet/ip_carp.c

Modified: head/sys/netinet/ip_carp.c
==============================================================================
--- head/sys/netinet/ip_carp.c	Fri Dec 30 21:00:45 2016	(r310863)
+++ head/sys/netinet/ip_carp.c	Fri Dec 30 21:33:01 2016	(r310864)
@@ -598,23 +598,29 @@ carp6_input(struct mbuf **mp, int *offp,
 static int
 carp_source_is_self(struct mbuf *m, struct ifaddr *ifa, sa_family_t af)
 {
+#ifdef INET
 	struct ip *ip4;
 	struct in_addr in4;
+#endif
+#ifdef INET6
 	struct ip6_hdr *ip6;
 	struct in6_addr in6;
+#endif
 
 	switch (af) {
+#ifdef INET
 	case AF_INET:
 		ip4 = mtod(m, struct ip *);
 		in4 = ifatoia(ifa)->ia_addr.sin_addr;
 		return (in4.s_addr == ip4->ip_src.s_addr);
-
+#endif
+#ifdef INET6
 	case AF_INET6:
 		ip6 = mtod(m, struct ip6_hdr *);
 		in6 = ifatoia6(ifa)->ia_addr.sin6_addr;
 		return (memcmp(&in6, &ip6->ip6_src, sizeof(in6)) == 0);
-
-	default:		/* how did this happen? */
+#endif
+	default:
 		break;
 	}
 	return (0);


More information about the svn-src-head mailing list