Skip to content

netutils/dhcpc: Select NET_SOCKOPTS with NET_BINDTODEVICE. - #3954

Closed
casaroli wants to merge 1 commit into
apache:masterfrom
casaroli:fb-dhcpc-sockopts-up
Closed

casaroli wants to merge 1 commit into
apache:masterfrom
casaroli:fb-dhcpc-sockopts-up

Conversation

@casaroli

@casaroli casaroli commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Summary

NETUTILS_DHCPC selects NET_BINDTODEVICE, which depends on NET_SOCKOPTS. A configuration that enables the DHCP client and no other option that selects NET_SOCKOPTS fails in olddefconfig:

warning: NET_BINDTODEVICE (defined at net/socket/Kconfig:88) has direct dependencies NET_SOCKOPTS && NET with value n, but is currently being y-selected by the following symbols:
 - NETUTILS_DHCPC (defined at netutils/dhcpc/Kconfig:6), with value y, direct dependencies NET_UDP (value: y), and select condition !NET_UDP_NO_STACK && NET_UDP (value: y)
make: *** [olddefconfig] Error 1
ERROR: failed to refresh

Since apache/nuttx#21320 removed the DNS client (which selected NET_SOCKOPTS) from lm3s6965-ek:qemu-protected, that configuration fails this way on NuttX master, so the arm-ti CI job fails. This PR makes NETUTILS_DHCPC select NET_SOCKOPTS under the same condition as NET_BINDTODEVICE, as netutils/webclient does.

Impact

Kconfig only. A configuration that builds today already has NET_SOCKOPTS when it has the DHCP client (or olddefconfig fails), so no other configuration changes.

Testing

NuttX master aa5b743e1e9, nuttx-apps master d40132f, GCC 13.2, lm3s6965-ek:qemu-protected:

apps master this PR
configure.sh fails in olddefconfig (above) OK, CONFIG_NET_SOCKOPTS=y, CONFIG_NET_BINDTODEVICE=y
build - OK, no warnings; kernel 128320 B of 131072 (kflash), user 121440 B
make savedefconfig - same as the defconfig

tools/checkpatch.sh -c -u -m -g passes.

NETUTILS_DHCPC selects NET_BINDTODEVICE, which depends on NET_SOCKOPTS.
A configuration that enables the DHCP client without another option
that selects NET_SOCKOPTS fails in olddefconfig ("NET_BINDTODEVICE has
direct dependencies NET_SOCKOPTS && NET with value n").  Since
apache/nuttx#21320 removed the DNS client from
lm3s6965-ek:qemu-protected, that configuration is one of them.

Select NET_SOCKOPTS under the same condition, as webclient does.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Marco Casaroli <[email protected]>
@casaroli

casaroli commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

@acassis I hope this should fix master CI

@Swatantra-66

Copy link
Copy Markdown
Contributor

@casaroli arm-stm32-other failed because selecting NET_SOCKOPTS here makes savedefconfig drop CONFIG_NET_SOCKOPTS=y from nucleo-h563zi:netnsh as redundant (causing the unstaged diff in nuttx).

The missing symbol was only hitting lm3s6965-ek:qemu-protected after #21320 dropped DNS client.
I opened apache/nuttx#21335 to re-enable CONFIG_NET_SOCKOPTS=y directly in that board's defconfig instead so we don't trigger normalization diffs on other boards.

@casaroli

casaroli commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

apache/nuttx#21335 fixes the lm3s6965-ek:qemu-protected build in the board defconfig; this Kconfig change makes savedefconfig drop CONFIG_NET_SOCKOPTS=y from other boards (nucleo-h563zi:netnsh).

@casaroli casaroli closed this Nov 1, 2026
Comment thread netutils/dhcpc/Kconfig
default n
depends on NET_UDP
select NET_SOCKOPTS if !NET_UDP_NO_STACK
select NET_BINDTODEVICE if !NET_UDP_NO_STACK

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can we change to depends on

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants