-
Notifications
You must be signed in to change notification settings - Fork 7.5k
DNS not working with NET_OFFLOAD #15124
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
Comments
I think I found the root cause of what is going on. In short, dns_resolver is getting inited before the offload interface. The details: Looking at I moved |
Nope, though you got the root cause: I think dns_resolver_init() should be moved out of l3_init(), it's not exactly part of l3 in fact: it's a service on top of the net stack (as dhcpv4 for instance). |
DNS is not part of L3, but as dhcpv4 or the net shell, it is a services on top of the network stack. So let's gather all in a dedicated function. This also rework the order when starting the DNS service. There was an issue for offload device: these would be fully initialized in init_rx_queues() which was called after l3_init. l3_init had already started dns: which would not be able to bind correctly, proving to be fully dead afterwards. Instead, starting the dns at the very end ensures that all is initialized properly from devices to stack. Fixes zephyrproject-rtos#15124 Signed-off-by: Tomasz Bursztyka <[email protected]>
@rerickson1 Please have a look at #15141 |
DNS is not part of L3, but as dhcpv4 or the net shell, it is a services on top of the network stack. So let's gather all in a dedicated function. This also rework the order when starting the DNS service. There was an issue for offload device: these would be fully initialized in init_rx_queues() which was called after l3_init. l3_init had already started dns: which would not be able to bind correctly, proving to be fully dead afterwards. Instead, starting the dns at the very end ensures that all is initialized properly from devices to stack. Fixes #15124 Signed-off-by: Tomasz Bursztyka <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
When using NET_OFFLOAD,
dns_write
does not work because it does not properly create the socket first. The first call indns_write
,net_context_recv
fails because a socket has not been created and associated tonet_ctx->offload_context
.To Reproduce
I have come across this during development of a new modem driver. TCP/UDP socket send/RX is working with my driver, so I don't believe it is an issue with my code.
You should be able to test using the WNCM14A2A modem driver and the NET_SHELL with DNS_RESOLVER turned on. I do not have any hardware I can use to test against the current zephyr master.
Expected behavior
DNS should be able to be used with NET_OFFLOAD.
Impact
Showstopper. Need DNS working with NET_OFFLOAD in order to complete my project.
Screenshots or console output
Stack trace showing that net_ctx->offload_context is NULL because it hasn't been created properly.
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: