Skip to content

net: Cherry-pick DHCP/DNS improvements #3062

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

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

rlubos
Copy link
Contributor

@rlubos rlubos commented Jul 18, 2025

A set of commits improving handling of DNS addresses assigned via DHCP in multi-interface environment.

jukkar added 11 commits July 22, 2025 09:46
Allow user to specify which network interfaces to bind the
server to when reconfiguring the DNS system.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit 2af5dba)
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Bind the network interface to the network interface we
have received the DNS servers from. This is now the default.
The previous behavior can be restored by disabling the
CONFIG_NET_DHCPV4_DNS_SERVER_VIA_INTERFACE option.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit 1224c5a)
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Bind the network interface to the network interface we
have received the DNS servers from. This is now the default.
The previous behavior can be restored by disabling the
CONFIG_NET_DHCPV6_DNS_SERVER_VIA_INTERFACE option.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit 248cb3d)
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
…erface

Make sure we cleanup only those DNS servers that belong to
certain network interface when the interface goes down.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit cb90524)
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Make sure that uninitialized state is 0 so that we can catch
when the context is not initialized properly.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit 514cdd6)
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
…ectly

The "net conn" command printed AF_PACKET socket as AF_UNK(3).
Fix this by printing "AF_PACKET" in this case.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit 57c452f)
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Make sure received DNS server information is bound to the
wifi network interface.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit 0e57844)
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Make sure received DNS server information is bound to the
ppp network interface.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit 8704b3a)
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
…servers

Remember which DNS server was added by a source like DHCPv4 or v6
message. This will allow system to remove DNS servers that were added by
that source. Then when stopping for example DHCP, we can remove those
specific DNS servers and not leaving DNS servers hanging in the system.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit cdc6c32)
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Make sure that we remove only the added DNS servers when
the DHCP is stopped.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit 2508420)
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Print information which DNS servers were added by DHCP when
listing DNS servers in "net dns" command. This helps debugging
DNS server issues.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit f1a9ff9)
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
@rlubos rlubos force-pushed the ncs/cherry-pick-dhcp-dns-fixes branch from 4f70b5b to bf3a6a2 Compare July 22, 2025 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants