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

net: dhcp: avoid build warnings when event mgmt disabled #33105

Closed
wants to merge 1 commit into from

Conversation

pabigot
Copy link
Collaborator

@pabigot pabigot commented Mar 7, 2021

If CONFIG_NET_MGMT_EVENT is not enabled then
net_mgmt_init_event_callback() is defined to a macro that ignores its
arguments, causing the callback structure and the handler to be unused
producing a build warning.

If CONFIG_NET_MGMT_EVENT is not enabled then
net_mgmt_init_event_callback() is defined to a macro that ignores its
arguments, causing the callback structure and the handler to be unused
producing a build warning.

Signed-off-by: Peter Bigot <[email protected]>
@pabigot
Copy link
Collaborator Author

pabigot commented Mar 7, 2021

It may be that enabling DHCP without NET_MGMT shouldn't be allowed; in any case something's wrong here. Try samples/subsys/shell/shell_module with these options:

CONFIG_NETWORKING=y
CONFIG_NET_SHELL=y
CONFIG_DNS_RESOLVER=y
CONFIG_NET_IPV4=y
CONFIG_NET_DHCPV4=y

@jukkar
Copy link
Member

jukkar commented Mar 8, 2021

It may be that enabling DHCP without NET_MGMT shouldn't be allowed

Yes, that is the case. After looking the code, the DHCP needs to know about the network interface status in order to trigger a renew when the network interface comes back up. It looks like we are missing proper selects for net mgmt config option in subsys/net/ip/Kconfig.ipv4 for DHCPv4.

@pabigot
Copy link
Collaborator Author

pabigot commented Mar 8, 2021

Closing this, track issue in #33137.

@pabigot pabigot closed this Mar 8, 2021
@pabigot pabigot deleted the nordic/20210307a branch March 15, 2021 13:10
@pabigot pabigot restored the nordic/20210307a branch March 15, 2021 13:11
@pabigot pabigot deleted the nordic/20210307a branch March 15, 2021 13:11
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.

2 participants