Module Name:    src
Committed By:   roy
Date:           Fri Jul 26 10:53:45 UTC 2019

Modified Files:
        src/external/bsd/dhcpcd/dist/src: dhcp6.c ipv6.c ipv6.h ipv6nd.c

Log Message:
As dhcpcd no longer supports IPv4 address advertisement for SMALL builds,
remove the equivalent IPv6 functionality.
This shouldn't be an issue as this is only used for IPv6 address sharing,
which only the NetBSD kernel currently supports.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/dhcpcd/dist/src/dhcp6.c
cvs rdiff -u -r1.1.1.17 -r1.2 src/external/bsd/dhcpcd/dist/src/ipv6.c
cvs rdiff -u -r1.1.1.11 -r1.2 src/external/bsd/dhcpcd/dist/src/ipv6.h
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/dhcpcd/dist/src/ipv6nd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/dhcpcd/dist/src/dhcp6.c
diff -u src/external/bsd/dhcpcd/dist/src/dhcp6.c:1.9 src/external/bsd/dhcpcd/dist/src/dhcp6.c:1.10
--- src/external/bsd/dhcpcd/dist/src/dhcp6.c:1.9	Wed Jul 24 09:57:43 2019
+++ src/external/bsd/dhcpcd/dist/src/dhcp6.c	Fri Jul 26 10:53:45 2019
@@ -1523,7 +1523,9 @@ dhcp6_dadcallback(void *arg)
 				if (valid)
 					dhcpcd_daemonise(ifp->ctx);
 			}
+#ifdef ND6_ADVERTISE
 			ipv6nd_advertise(ia);
+#endif
 		}
 	}
 }
@@ -3927,16 +3929,20 @@ dhcp6_free(struct interface *ifp)
 void
 dhcp6_abort(struct interface *ifp)
 {
+#ifdef ND6_ADVERTISE
 	struct dhcp6_state *state;
 	struct ipv6_addr *ia;
+#endif
 
 	eloop_timeout_delete(ifp->ctx->eloop, dhcp6_start1, ifp);
+#ifdef ND6_ADVERTISE
 	state = D6_STATE(ifp);
 	if (state == NULL)
 		return;
 	TAILQ_FOREACH(ia, &state->addrs, next) {
 		ipv6nd_advertise(ia);
 	}
+#endif
 }
 
 void

Index: src/external/bsd/dhcpcd/dist/src/ipv6.c
diff -u src/external/bsd/dhcpcd/dist/src/ipv6.c:1.1.1.17 src/external/bsd/dhcpcd/dist/src/ipv6.c:1.2
--- src/external/bsd/dhcpcd/dist/src/ipv6.c:1.1.1.17	Wed Jul 24 09:54:54 2019
+++ src/external/bsd/dhcpcd/dist/src/ipv6.c	Fri Jul 26 10:53:45 2019
@@ -616,8 +616,10 @@ ipv6_deleteaddr(struct ipv6_addr *ia)
 		}
 	}
 
+#ifdef ND6_ADVERTISE
 	/* Advertise the address if it exists on another interface. */
 	ipv6nd_advertise(ia);
+#endif
 }
 
 static int
@@ -625,8 +627,10 @@ ipv6_addaddr1(struct ipv6_addr *ia, cons
 {
 	struct interface *ifp;
 	uint32_t pltime, vltime;
-	bool vltime_was_zero;
 	__printflike(1, 2) void (*logfunc)(const char *, ...);
+#ifdef ND6_ADVERTISE
+	bool vltime_was_zero;
+#endif
 #ifdef __sun
 	struct ipv6_state *state;
 	struct ipv6_addr *ia2;
@@ -694,7 +698,9 @@ ipv6_addaddr1(struct ipv6_addr *ia, cons
 		    " seconds",
 		    ifp->name, ia->prefix_pltime, ia->prefix_vltime);
 
+#ifdef ND6_ADVERTISE
 	vltime_was_zero = ia->prefix_vltime == 0;
+#endif
 	if (if_address6(RTM_NEWADDR, ia) == -1) {
 		logerr(__func__);
 		/* Restore real pltime and vltime */
@@ -758,9 +764,11 @@ ipv6_addaddr1(struct ipv6_addr *ia, cons
 	}
 #endif
 
+#ifdef ND6_ADVERTISE
 	/* Re-advertise the preferred address to be safe. */
 	if (!vltime_was_zero)
 		ipv6nd_advertise(ia);
+#endif
 
 	return 0;
 }
@@ -1081,9 +1089,11 @@ ipv6_handleifa(struct dhcpcd_ctx *ctx,
 	case RTM_DELADDR:
 		if (ia != NULL) {
 			TAILQ_REMOVE(&state->addrs, ia, next);
+#ifdef ND6_ADVERTISE
 			/* Advertise the address if it exists on
 			 * another interface. */
 			ipv6nd_advertise(ia);
+#endif
 			/* We'll free it at the end of the function. */
 		}
 		break;

Index: src/external/bsd/dhcpcd/dist/src/ipv6.h
diff -u src/external/bsd/dhcpcd/dist/src/ipv6.h:1.1.1.11 src/external/bsd/dhcpcd/dist/src/ipv6.h:1.2
--- src/external/bsd/dhcpcd/dist/src/ipv6.h:1.1.1.11	Wed Jul 24 09:54:54 2019
+++ src/external/bsd/dhcpcd/dist/src/ipv6.h	Fri Jul 26 10:53:45 2019
@@ -149,6 +149,10 @@
 #  define IN6_IFF_DETACHED	0
 #endif
 
+#ifndef SMALL
+#  define ND6_ADVERTISE
+#endif
+
 #ifdef INET6
 TAILQ_HEAD(ipv6_addrhead, ipv6_addr);
 struct ipv6_addr {

Index: src/external/bsd/dhcpcd/dist/src/ipv6nd.c
diff -u src/external/bsd/dhcpcd/dist/src/ipv6nd.c:1.8 src/external/bsd/dhcpcd/dist/src/ipv6nd.c:1.9
--- src/external/bsd/dhcpcd/dist/src/ipv6nd.c:1.8	Wed Jul 24 09:57:43 2019
+++ src/external/bsd/dhcpcd/dist/src/ipv6nd.c	Fri Jul 26 10:53:45 2019
@@ -389,6 +389,7 @@ ipv6nd_sendrsprobe(void *arg)
 	}
 }
 
+#ifdef ND6_ADVERTISE
 static void
 ipv6nd_sendadvertisement(void *arg)
 {
@@ -526,6 +527,7 @@ ipv6nd_advertise(struct ipv6_addr *ia)
 	eloop_timeout_delete(ctx->eloop, ipv6nd_sendadvertisement, iaf);
 	ipv6nd_sendadvertisement(iaf);
 }
+#endif /* ND6_ADVERTISE */
 
 static void
 ipv6nd_expire(void *arg)
@@ -908,7 +910,9 @@ try_script:
 					return;
 			}
 		}
+#ifdef ND6_ADVERTISE
 		ipv6nd_advertise(ia);
+#endif
 	}
 }
 

Reply via email to