RIOT-OS / RIOT

RIOT - The friendly OS for IoT
https://riot-os.org
GNU Lesser General Public License v2.1
4.97k stars 1.99k forks source link

gnrc_border_router: Kconfig and C disagree about number of addresses per interface #19947

Open miri64 opened 1 year ago

miri64 commented 1 year ago

Description

When running the border router with UHCP and trying to add another address to the upstream interface, you are unable to add it, since it only accepts 2 (as configured in sys/include/net/gnrc/netif/conf.h). However, with make menuconfig it shows 3 available addresses. That config is not applied, however, if menuconfig is not saved.

Steps to reproduce the issue

Flash examples/gnrc_border_router to any board, connect with UHCP for address configuration and try to add another address to the upstream interface e.g.

ifconfig 3 add 2001:db8::2

With

make menuconfig

have a look at System → Networking → GNRC Network stack → Configure GNRC network interface, and look at Maximum number of unicast and anycast addresses per interface. It should be 3. Exit the menuconfig and do not save! (and make sure for good measure that examples/gnrc_border_router/bin/<board>/generated is empty.)

Expected results

You should be able to add the address, at least going by the Kconfig.

Actual results

The ifconfig shell command fails with

error: unable to add IPv6 address

If you run make menuconfig and safe this time (hitting s), and try to repeat the steps to reproduce, the expected result will be seen.

Versions

Current master (based on 2022.10-devel)

MrKevinWeiss commented 1 year ago

From what I can tell the SHOULD_RUN_KCONFIG is defaulted to off. Even when setting it on I notice it still takes the header value. It seems like the dependencies are not being met in order for the kconfig to set something (either in the application kconfig or the sys kconfig).

I think you have to manually enable KCONFIG_USEMODULE_GNRC_NETIF if you wanted the default. If you don't save it doesn't get updated.

KCONFIG_USEMODULE_: Used during transition to enable configuration of a module via Kconfig