From: Roy Marples Date: Mon, 19 Jul 2021 20:22:44 +0000 (+0100) Subject: IPv4LL: Don't remove statically assigned addresses X-Git-Tag: v10.0.0~86 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=477cd9669c4c658a8f5eb3d25c1d9f9a3c429f85;p=thirdparty%2Fdhcpcd.git IPv4LL: Don't remove statically assigned addresses Fixes #37. While here, don't open a DHCP port for static addresses either when not in manager mode. --- diff --git a/src/dhcp.c b/src/dhcp.c index c1916133..0e1ac3eb 100644 --- a/src/dhcp.c +++ b/src/dhcp.c @@ -2031,7 +2031,8 @@ dhcp_finish_dad(struct interface *ifp, struct in_addr *ia) #ifdef IPV4LL /* Stop IPv4LL now we have a working DHCP address */ - ipv4ll_drop(ifp); + if (!IN_LINKLOCAL(ntohl(ia->s_addr))) + ipv4ll_drop(ifp); #endif if (ifp->options->options & DHCPCD_INFORM) @@ -2382,6 +2383,7 @@ dhcp_bind(struct interface *ifp) openudp: /* If not in manager mode, open an address specific socket. */ if (ctx->options & DHCPCD_MANAGER || + ifo->options & DHCPCD_STATIC || (state->old != NULL && state->old->yiaddr == state->new->yiaddr && old_state & STATE_ADDED && !(old_state & STATE_FAKE)))