]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
IPv4LL: If we are not configuring, abort if address does not exist
authorRoy Marples <roy@marples.name>
Thu, 1 Aug 2024 16:06:51 +0000 (17:06 +0100)
committerRoy Marples <roy@marples.name>
Thu, 1 Aug 2024 16:06:51 +0000 (17:06 +0100)
Fixes a segfault as we would not add the address and we would
expect to find it.

src/ipv4ll.c

index 43974a80bea06f45587acf445a6860bb46ffc187..5b2c48bb14d9725db36dcdd5dabb378c4ee75ab0 100644 (file)
@@ -400,10 +400,13 @@ ipv4ll_start(void *arg)
 #ifdef IN_IFF_DUPLICATED
                loginfox("%s: using IPv4LL address %s", ifp->name, ia->saddr);
 #endif
-       } else {
+       } else if (ifp->options->options & DHCPCD_CONFIGURE) {
                loginfox("%s: probing for an IPv4LL address", ifp->name);
                if (repick || state->pickedaddr.s_addr == INADDR_ANY)
                        ipv4ll_pickaddr(ifp);
+       } else {
+               logwarnx("%s: refusing to configure IPv4LL", ifp->name);
+               return;
        }
 
        ipv4ll_start_arp(ifp);