changeset 4481:7848309c100c draft

sun: Don't define IN_IFF_TENTATIVE or IN_IFF_DETACHED Let's not pretend these exist and adjust existing #ifdefs to compensate.
author Roy Marples <roy@marples.name>
date Thu, 25 Apr 2019 12:04:45 +0000
parents d3e01f5908b4
children c766946ba748
files src/dhcp.c src/ipv4.h src/ipv4ll.c
diffstat 3 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/dhcp.c	Thu Apr 25 12:02:50 2019 +0000
+++ b/src/dhcp.c	Thu Apr 25 12:04:45 2019 +0000
@@ -2077,7 +2077,7 @@
 	    ifp->name, inet_ntoa(astate->addr));
 	if (!(ifo->options & DHCPCD_INFORM))
 		dhcp_bind(ifp);
-#ifndef IN_IFF_TENTATIVE
+#ifndef IN_IFF_DUPLICATED
 	else {
 		struct bootp *bootp;
 		size_t len;
@@ -2431,7 +2431,7 @@
 	if (astate == NULL)
 		return -1;
 
-#ifdef IN_IFF_TENTATIVE
+#ifdef IN_IFF_NOTUSEABLE
 	if (ia == NULL || ia->addr_flags & IN_IFF_NOTUSEABLE) {
 		state->state = DHS_PROBE;
 		if (ia == NULL) {
--- a/src/ipv4.h	Thu Apr 25 12:02:50 2019 +0000
+++ b/src/ipv4.h	Thu Apr 25 12:04:45 2019 +0000
@@ -62,9 +62,8 @@
     * While it supports DaD, to seems to only expose IFF_DUPLICATE
     * so we have no way of knowing if it's tentative or not.
     * I don't even know if Solaris has any special treatment for tentative. */
-#  define IN_IFF_TENTATIVE	0
 #  define IN_IFF_DUPLICATED	0x02
-#  define IN_IFF_DETACHED	0
+#  define IN_IFF_NOTUSEABLE	IN_IFF_DUPLICATED
 #endif
 
 #ifdef IN_IFF_TENTATIVE
--- a/src/ipv4ll.c	Thu Apr 25 12:02:50 2019 +0000
+++ b/src/ipv4ll.c	Thu Apr 25 12:04:45 2019 +0000
@@ -232,7 +232,7 @@
 ipv4ll_probe(void *arg)
 {
 
-#ifdef IN_IFF_TENTATIVE
+#ifdef IN_IFF_DUPLICATED
 	ipv4ll_probed(arg);
 #else
 	arp_probe(arg);
@@ -404,7 +404,7 @@
 	if (ia == NULL)
 		ia = ipv4_iffindlladdr(ifp);
 
-#ifdef IN_IFF_TENTATIVE
+#ifdef IN_IFF_DUPLICATED
 	if (ia != NULL && ia->addr_flags & IN_IFF_DUPLICATED) {
 		ipv4_deladdr(ia, 0);
 		ia = NULL;
@@ -419,6 +419,8 @@
 			    ifp->name, inet_ntoa(ia->addr));
 			return;
 		}
+#endif
+#ifdef IN_IFF_DUPLICATED
 		loginfox("%s: using IPv4LL address %s", ifp->name, ia->saddr);
 #endif
 		ipv4ll_probed(astate);
@@ -429,7 +431,7 @@
 	if (state->pickedaddr.s_addr == INADDR_ANY)
 		state->pickedaddr.s_addr = ipv4ll_pickaddr(astate);
 	astate->addr = state->pickedaddr;
-#ifdef IN_IFF_TENTATIVE
+#ifdef IN_IFF_DUPLICATED
 	ipv4ll_probed(astate);
 #else
 	arp_probe(astate);