tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

MKINET6=no fixes



I found the following patch to be necessary when trying to compile
-current/amd64 with MKINET6=no.

One issue is that it isn't obvious to me where the boundary between
MKINET6 and USE_INET6 is.  e.g., after compiling route with
MKINET6=no, would expect to see

Protocol Family 24:
Destination        Gateway            Flags    Refs      Use    Mtu Interface
af 24: Q00.00.00.0 (24) Q00.00.00.00. UGR         -        -      -  lo0
af 24: Q00.00.00.0 (24) Q00.00.00.00. UGR         -        -      -  lo0

or just have that part omitted?

Makes enough sense to commit?

Cheers,

Patrick
Index: external/apache2/mDNSResponder/dist/mDNSPosix/mDNSPosix.c
===================================================================
RCS file: /cvsroot/src/external/apache2/mDNSResponder/dist/mDNSPosix/mDNSPosix.c,v
retrieving revision 1.6
diff -u -r1.6 mDNSPosix.c
--- external/apache2/mDNSResponder/dist/mDNSPosix/mDNSPosix.c	31 Mar 2014 23:26:30 -0000	1.6
+++ external/apache2/mDNSResponder/dist/mDNSPosix/mDNSPosix.c	13 Dec 2014 14:47:24 -0000
@@ -718,7 +718,7 @@
 				err = setsockopt(*sktPtr, IPPROTO_IPV6, IPV6_RECVPKTINFO, &kOn, sizeof(kOn));
 				if (err < 0) { err = errno; perror("setsockopt - IPV6_RECVPKTINFO"); }
 			}
-#elif defined(IPV6_PKTINFO)
+	#elif defined(IPV6_PKTINFO)
 		if (err == 0)
 			{
 				err = setsockopt(*sktPtr, IPPROTO_IPV6, IPV6_PKTINFO, &kOn, sizeof(kOn));
Index: external/bsd/dhcpcd/dist/dhcpcd.c
===================================================================
RCS file: /cvsroot/src/external/bsd/dhcpcd/dist/dhcpcd.c,v
retrieving revision 1.19
diff -u -r1.19 dhcpcd.c
--- external/bsd/dhcpcd/dist/dhcpcd.c	9 Dec 2014 20:21:05 -0000	1.19
+++ external/bsd/dhcpcd/dist/dhcpcd.c	13 Dec 2014 14:47:25 -0000
@@ -744,8 +744,9 @@
 		    !(ifo->options & (DHCPCD_INFORM | DHCPCD_PFXDLGONLY)))
 			ipv6nd_startrs(ifp);
 
-		if (ifo->options & DHCPCD_DHCP6)
+		if (ifo->options & DHCPCD_DHCP6) {
 			dhcp6_find_delegates(ifp);
+		}
 
 		if (!(ifo->options & DHCPCD_IPV6RS) ||
 		    ifo->options & DHCPCD_IA_FORCED)
Index: external/bsd/ipf/dist/lib/printhost.c
===================================================================
RCS file: /cvsroot/src/external/bsd/ipf/dist/lib/printhost.c,v
retrieving revision 1.2
diff -u -r1.2 printhost.c
--- external/bsd/ipf/dist/lib/printhost.c	22 Jul 2012 14:27:36 -0000	1.2
+++ external/bsd/ipf/dist/lib/printhost.c	13 Dec 2014 14:47:25 -0000
@@ -25,9 +25,9 @@
 	if ((family == -1) || !*addr)
 		PRINTF("any");
 	else {
+#ifdef  USE_INET6
 		void *ptr = addr;
 
-#ifdef  USE_INET6
 		PRINTF("%s", inet_ntop(family, ptr, ipbuf, sizeof(ipbuf)));
 #else
 		ipa.s_addr = *addr;
Index: external/bsd/ipf/dist/lib/printhostmask.c
===================================================================
RCS file: /cvsroot/src/external/bsd/ipf/dist/lib/printhostmask.c,v
retrieving revision 1.2
diff -u -r1.2 printhostmask.c
--- external/bsd/ipf/dist/lib/printhostmask.c	22 Jul 2012 14:27:36 -0000	1.2
+++ external/bsd/ipf/dist/lib/printhostmask.c	13 Dec 2014 14:47:25 -0000
@@ -25,9 +25,9 @@
 	if ((family == -1) || ((!addr || !*addr) && (!mask || !*mask)))
 		PRINTF("any");
 	else {
+#ifdef  USE_INET6
 		void *ptr = addr;
 
-#ifdef  USE_INET6
 		PRINTF("%s", inet_ntop(family, ptr, ipbuf, sizeof(ipbuf)));
 #else
 		ipa.s_addr = *addr;
Index: external/bsd/ipf/dist/lib/printipfexpr.c
===================================================================
RCS file: /cvsroot/src/external/bsd/ipf/dist/lib/printipfexpr.c,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 printipfexpr.c
--- external/bsd/ipf/dist/lib/printipfexpr.c	22 Jul 2012 13:44:41 -0000	1.1.1.2
+++ external/bsd/ipf/dist/lib/printipfexpr.c	13 Dec 2014 14:47:25 -0000
@@ -5,7 +5,9 @@
 static void printport __P((int *));
 static void printhosts __P((int *));
 static void printsingle __P((int *));
+#ifdef USE_INET6
 static void printhostsv6 __P((int *));
+#endif
 
 void
 printipfexpr(array)
Index: external/bsd/ipf/dist/lib/save_v1trap.c
===================================================================
RCS file: /cvsroot/src/external/bsd/ipf/dist/lib/save_v1trap.c,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 save_v1trap.c
--- external/bsd/ipf/dist/lib/save_v1trap.c	22 Jul 2012 13:44:42 -0000	1.1.1.2
+++ external/bsd/ipf/dist/lib/save_v1trap.c	13 Dec 2014 14:47:25 -0000
@@ -180,7 +180,7 @@
 		if (ctx->fd >= 0) {
 			ctx->sin.sin_family = AF_INET;
 			ctx->sin.sin_port = htons(162);
-			if (connect(ctx->fd, &ctx->sin,
+			if (connect(ctx->fd, (struct sockaddr *)&ctx->sin,
 				    sizeof(ctx->sin)) != 0) {
 					snmpv1_destroy(ctx);
 					return NULL;
Index: external/bsd/ipf/dist/lib/save_v2trap.c
===================================================================
RCS file: /cvsroot/src/external/bsd/ipf/dist/lib/save_v2trap.c,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 save_v2trap.c
--- external/bsd/ipf/dist/lib/save_v2trap.c	22 Jul 2012 13:44:43 -0000	1.1.1.2
+++ external/bsd/ipf/dist/lib/save_v2trap.c	13 Dec 2014 14:47:25 -0000
@@ -183,7 +183,7 @@
 		if (ctx->fd >= 0) {
 			ctx->sin.sin_family = AF_INET;
 			ctx->sin.sin_port = htons(162);
-			if (connect(ctx->fd, &ctx->sin,
+			if (connect(ctx->fd, (struct sockaddr *)&ctx->sin,
 				    sizeof(ctx->sin)) != 0) {
 					snmpv2_destroy(ctx);
 					return NULL;
Index: external/bsd/ipf/dist/tools/lexer.c
===================================================================
RCS file: /cvsroot/src/external/bsd/ipf/dist/tools/lexer.c,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 lexer.c
--- external/bsd/ipf/dist/tools/lexer.c	22 Jul 2012 13:44:59 -0000	1.1.1.2
+++ external/bsd/ipf/dist/tools/lexer.c	13 Dec 2014 14:47:25 -0000
@@ -176,8 +176,10 @@
 
 int yylex()
 {
+#ifdef	USE_INET6
 	static int prior = 0;
 	static int priornum = 0;
+#endif
 	int c, n, isbuilding, rval, lnext, nokey = 0;
 	char *name;
 	int triedv6 = 0;
@@ -239,7 +241,9 @@
 	if (lnext == 1) {
 		lnext = 0;
 		if ((isbuilding == 0) && !ISALNUM(c)) {
+#ifdef	USE_INET6
 			prior = c;
+#endif
 			return c;
 		}
 		goto nextchar;
@@ -330,7 +334,9 @@
 		yytokentype = 0;
 		if (yydebug)
 			fprintf(stderr, "reset at EOF\n");
+#ifdef	USE_INET6
 		prior = 0;
+#endif
 		return 0;
 	}
 
@@ -594,9 +600,11 @@
 		yypos = 0;
 	}
 
+#ifdef	USE_INET6
 	if (rval == YY_NUMBER)
 		priornum = yylval.num;
 	prior = rval;
+#endif
 	return rval;
 }
 
Index: external/bsd/ntp/dist/ntpd/ntp_io.c
===================================================================
RCS file: /cvsroot/src/external/bsd/ntp/dist/ntpd/ntp_io.c,v
retrieving revision 1.14
diff -u -r1.14 ntp_io.c
--- external/bsd/ntp/dist/ntpd/ntp_io.c	26 Jan 2014 02:21:08 -0000	1.14
+++ external/bsd/ntp/dist/ntpd/ntp_io.c	13 Dec 2014 14:47:33 -0000
@@ -2337,7 +2337,7 @@
 #ifdef IP_MULTICAST_LOOP
 	TYPEOF_IP_MULTICAST_LOOP off = 0;
 #endif
-#ifdef IPV6_MULTICAST_LOOP
+#if defined(INCLUDE_IPV6_MULTICAST_SUPPORT) && defined(IPV6_MULTICAST_LOOP)
 	u_int off6 = 0;
 #endif
 
Index: external/bsd/ppp/usr.sbin/pppd/sys-bsd.c
===================================================================
RCS file: /cvsroot/src/external/bsd/ppp/usr.sbin/pppd/sys-bsd.c,v
retrieving revision 1.2
diff -u -r1.2 sys-bsd.c
--- external/bsd/ppp/usr.sbin/pppd/sys-bsd.c	25 Oct 2014 19:06:34 -0000	1.2
+++ external/bsd/ppp/usr.sbin/pppd/sys-bsd.c	13 Dec 2014 14:47:34 -0000
@@ -189,7 +189,9 @@
 static int max_in_fd;		/* highest fd set in in_fds */
 
 static int if_is_up;		/* the interface is currently up */
+#ifdef INET6
 static int if6_is_up;		/* the interface is currently up */
+#endif /* INET6 */
 static u_int32_t ifaddrs[2];	/* local and remote addresses we set */
 static u_int32_t default_route_gateway;	/* gateway addr for default route */
 static u_int32_t proxy_arp_addr;	/* remote addr for proxy arp */
Index: external/bsd/tcpdump/bin/Makefile
===================================================================
RCS file: /cvsroot/src/external/bsd/tcpdump/bin/Makefile,v
retrieving revision 1.11
diff -u -r1.11 Makefile
--- external/bsd/tcpdump/bin/Makefile	20 Nov 2014 03:05:03 -0000	1.11
+++ external/bsd/tcpdump/bin/Makefile	13 Dec 2014 14:47:34 -0000
@@ -35,7 +35,6 @@
 print-ascii.c \
 print-atalk.c \
 print-atm.c \
-print-babel.c \
 print-beep.c \
 print-bfd.c \
 print-bgp.c \
@@ -172,7 +171,7 @@
 CPPFLAGS+=-DWITH_CHROOT=\"/var/chroot/tcpdump\"
 
 .if (${USE_INET6} != "no")
-SRCS+=	print-ip6.c print-ip6opts.c print-icmp6.c \
+SRCS+=	print-babel.c print-ip6.c print-ip6opts.c print-icmp6.c \
 	print-rt6.c print-dhcp6.c print-ospf6.c 
 
 CPPFLAGS+=-DINET6=1 -DHAVE_RES_USE_INET6=1 
Index: sbin/route/route.c
===================================================================
RCS file: /cvsroot/src/sbin/route/route.c,v
retrieving revision 1.147
diff -u -r1.147 route.c
--- sbin/route/route.c	12 Nov 2014 03:34:08 -0000	1.147
+++ sbin/route/route.c	13 Dec 2014 14:47:42 -0000
@@ -1033,8 +1033,10 @@
 int
 prefixlen(const char *s, struct sou *soup)
 {
-	int len = atoi(s), q, r;
-	int max;
+	int max, len = atoi(s);
+#ifdef INET6
+	int q, r;
+#endif
 
 	switch (af) {
 	case AF_INET:
@@ -1054,8 +1056,10 @@
 	if (len < -1 || len > max)
 		errx(EXIT_FAILURE, "%s: bad value", s);
 	
+#ifdef INET6
 	q = len >> 3;
 	r = len & 7;
+#endif
 	switch (af) {
 	case AF_INET:
 		memset(soup->so_mask, 0, sizeof(*soup->so_mask));
Index: usr.sbin/lpr/common_source/Makefile
===================================================================
RCS file: /cvsroot/src/usr.sbin/lpr/common_source/Makefile,v
retrieving revision 1.11
diff -u -r1.11 Makefile
--- usr.sbin/lpr/common_source/Makefile	3 May 2008 14:48:32 -0000	1.11
+++ usr.sbin/lpr/common_source/Makefile	13 Dec 2014 14:47:45 -0000
@@ -1,8 +1,14 @@
 #	$NetBSD: Makefile,v 1.11 2008/05/03 14:48:32 lukem Exp $
 
+.include <bsd.own.mk>
+
 LIBISPRIVATE=	yes
 
 LIB=	common
 SRCS=	common.c common_vars.c displayq.c fatal.c rmjob.c startdaemon.c
 
+.if (${USE_INET6} != "no")
+CPPFLAGS.common.c=	-DINET6
+.endif
+
 .include <bsd.lib.mk>
Index: usr.sbin/lpr/common_source/common.c
===================================================================
RCS file: /cvsroot/src/usr.sbin/lpr/common_source/common.c,v
retrieving revision 1.42
diff -u -r1.42 common.c
--- usr.sbin/lpr/common_source/common.c	13 Nov 2013 21:19:17 -0000	1.42
+++ usr.sbin/lpr/common_source/common.c	13 Dec 2014 14:47:45 -0000
@@ -350,13 +350,15 @@
 const char *
 checkremote(void)
 {
-	char lname[NI_MAXHOST], rname[NI_MAXHOST];
-	struct addrinfo hints, *res, *res0;
+	struct addrinfo hints, *res0;
 	static char errbuf[128];
 	int error;
-	struct ifaddrs *ifap, *ifa;
+	struct ifaddrs *ifap;
+#if defined(INET6) && defined(__KAME__)
+	char lname[NI_MAXHOST], rname[NI_MAXHOST];
+	struct addrinfo *res;
+	struct ifaddrs *ifa;
 	const int niflags = NI_NUMERICHOST;
-#ifdef __KAME__
 	struct sockaddr_in6 sin6;
 	struct sockaddr_in6 *sin6p;
 #endif
@@ -379,7 +381,6 @@
 	hints.ai_flags = AI_CANONNAME;
 	hints.ai_family = PF_UNSPEC;
 	hints.ai_socktype = SOCK_STREAM;
-	res = NULL;
 	error = getaddrinfo(gethost(RM), NULL, &hints, &res0);
 	if (error) {
 		(void)snprintf(errbuf, sizeof(errbuf),
@@ -391,6 +392,7 @@
 
 	remote = 1;	/* assume printer is remote */
 
+#if defined(INET6) && defined(__KAME__)
 	for (res = res0; res; res = res->ai_next) {
 		if (getnameinfo(res->ai_addr, res->ai_addrlen,
 		    rname, sizeof(rname), NULL, 0, niflags) != 0)
@@ -412,6 +414,7 @@
 		}
 	}
 done:
+#endif
 	freeaddrinfo(res0);
 	freeifaddrs(ifap);
 	return NULL;


Home | Main Index | Thread Index | Old Index