From 0a38e02a894af79c6f5cdc1ede0c2cc6184dca59 Mon Sep 17 00:00:00 2001 From: Colin McInnes Date: Sat, 22 Feb 2025 07:37:59 -0600 Subject: [PATCH] Only drop IPv4 LL addresses if configured to handle them (#464) --- src/dhcp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/dhcp.c b/src/dhcp.c index 3b8f0198..3de4bfce 100644 --- a/src/dhcp.c +++ b/src/dhcp.c @@ -2170,7 +2170,8 @@ dhcp_finish_dad(struct interface *ifp, struct in_addr *ia) #ifdef IPV4LL /* Stop IPv4LL now we have a working DHCP address */ - if (!IN_LINKLOCAL(ntohl(ia->s_addr))) + if ((!IN_LINKLOCAL(ntohl(ia->s_addr))) + && (ifp->options->options & DHCPCD_IPV4LL)) ipv4ll_drop(ifp); #endif @@ -3329,7 +3330,8 @@ dhcp_handledhcp(struct interface *ifp, struct bootp *bootp, size_t bootp_len, switch (tmp) { case 0: LOGDHCP(LOG_WARNING, "IPv4LL disabled from"); - ipv4ll_drop(ifp); + if (ifp->options->options & DHCPCD_IPV4LL) + ipv4ll_drop(ifp); #ifdef ARP arp_drop(ifp); #endif -- 2.47.2