Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only drop IPv4 LL addresses if configured to handle them #464

Merged
merged 1 commit into from
Feb 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/dhcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better to do this inside ipv4ll_drop?

ipv4ll_drop(ifp);
#endif

Expand Down Expand Up @@ -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
Expand Down