]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
IPv4LL: Don't remove statically assigned addresses
authorRoy Marples <roy@marples.name>
Mon, 19 Jul 2021 20:22:44 +0000 (21:22 +0100)
committerRoy Marples <roy@marples.name>
Mon, 19 Jul 2021 20:22:44 +0000 (21:22 +0100)
Fixes #37.

While here, don't open a DHCP port for static addresses either
when not in manager mode.

src/dhcp.c

index c1916133ba2547d8c87bae13bb1c850c84f0d001..0e1ac3eb0671943beae833e2558f974c2581ed81 100644 (file)
@@ -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)))