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

CONFIG_SYSTEM_DHCPC_RENEW6 implicitly depends on CONFIG_NET_ICMPv6_AUTOCONF #2412

Open
sumpfralle opened this issue Jun 11, 2024 · 0 comments

Comments

@sumpfralle
Copy link

sumpfralle commented Jun 11, 2024

Versions

  • nuttx: nuttx-8.2-17639-gafb368afd2
  • nuttx-apps: nuttx-12.5.0-89-g364f8cd41

How to reproduce

make distclean
tools/configure.sh -l sim:nsh
kconfig-tweak --enable CONFIG_NET
kconfig-tweak --keep-case --enable CONFIG_NET_IPv6
kconfig-tweak --enable CONFIG_NET_UDP
kconfig-tweak --keep-case --enable CONFIG_NET_ICMPv6
kconfig-tweak --enable CONFIG_SYSTEM_DHCPC_RENEW6
make olddefconfig
make

The linking fails:

/usr/bin/ld: nuttx.rel: in function `renew6_main':
/home/example/git/nuttx/nuttx-apps/system/dhcp6c/renew6_main.c:46:(.text.renew6_main+0x35): undefined reference to `netlib_obtain_ipv6addr'
collect2: error: ld returned 1 exit status

The missing function is called here: https://github.com/apache/nuttx-apps/blob/master/system/dhcp6c/renew6_main.c#L46

The function is implemented here: https://github.com/apache/nuttx-apps/blob/master/netutils/netlib/netlib_obtainipv6addr.c#L151

Workaround

--- a/system/dhcp6c/Kconfig
+++ b/system/dhcp6c/Kconfig
@@ -7,7 +7,7 @@ config SYSTEM_DHCPC_RENEW6
        tristate "DHCP IPv6 Address Renewal"
        default n
        select NETUTILS_DHCP6C
-       depends on NET_UDP && NET_IPv6
+       depends on NET_UDP && NET_IPv6 && NET_ICMPv6_AUTOCONF
        ---help---
                Enable the DHCP client 'renew6' command
 

The above patch adds NET_ICMPv6_AUTOCONF as a dependency.

Afterwards the expanded procedure works a bit better (added AUTOCONF):

make distclean
tools/configure.sh -l sim:nsh
kconfig-tweak --enable CONFIG_NET
kconfig-tweak --keep-case --enable CONFIG_NET_IPv6
kconfig-tweak --enable CONFIG_NET_UDP
kconfig-tweak --keep-case --enable CONFIG_NET_ICMPv6
kconfig-tweak --keep-case --enable CONFIG_NET_ICMPv6_AUTOCONF
kconfig-tweak --enable CONFIG_SYSTEM_DHCPC_RENEW6
make olddefconfig
make

Now it fails later:

/usr/bin/ld: nuttx.rel: in function `dhcp6c_command':
/home/lars/git/nuttx/nuttx-apps/netutils/dhcp6c/dhcp6c.c:857:(.text.dhcp6c_command+0x3c5): undefined reference to `NXsetsockopt'
/usr/bin/ld: nuttx.rel: in function `dhcp6c_precise_open':
/home/lars/git/nuttx/nuttx-apps/netutils/dhcp6c/dhcp6c.c:1792:(.text.dhcp6c_precise_open+0x493): undefined reference to `NXsetsockopt'
/usr/bin/ld: /home/lars/git/nuttx/nuttx-apps/netutils/dhcp6c/dhcp6c.c:1793:(.text.dhcp6c_precise_open+0x4c0): undefined reference to `NXsetsockopt'
/usr/bin/ld: /home/lars/git/nuttx/nuttx-apps/netutils/dhcp6c/dhcp6c.c:1794:(.text.dhcp6c_precise_open+0x4f6): undefined reference to `NXsetsockopt'
collect2: error: ld returned 1 exit status

But the above error is probably related to the selected platform (sim:nsh).

Is the added dependency the proper way to solve this issue? In this case I could prepare a PR.

UPDATE: I previously mentioned CONFIG_ICMPv6_SOCKET (instead of _AUTOCONF), but the former setting is not related to the problem above.

@sumpfralle sumpfralle changed the title CONFIG_SYSTEM_DHCPC_RENEW6 implicitly depends on CONFIG_NET_ICMPv6_SOCKET CONFIG_SYSTEM_DHCPC_RENEW6 implicitly depends on CONFIG_NET_ICMPv6_AUTOCONF Jun 11, 2024
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

No branches or pull requests

1 participant