You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "nuttxs (via GitHub)" <gi...@apache.org> on 2025/11/06 04:13:14 UTC

[PR] netutils/netlib: support delete the DNS server address by index or address [nuttx-apps]

nuttxs opened a new pull request, #3206:
URL: https://github.com/apache/nuttx-apps/pull/3206

   ## Summary
   
   netlib/netlib_delipv4dnsaddr.c: add DNS deletion functionality, support deleting DNS servers by address or by index:
   ```
   netlib_del_ipv4dnsaddr()
   netlib_del_ipv4dnsaddr_by_index()
   netlib_del_ipv6dnsaddr()
   netlib_del_ipv6dnsaddr_by_index()
   
   ```
   ```
   Multi-DNS delete Call-Chain Implementation:
   Application Layer: netlib_del_ipv4dnsaddr() / netlib_del_ipv6dnsaddr()
              ↓
   Network Layer: dns_del_nameserver()
              ↓
   Storage Layer: g_dns_servers[] array
   ```
   
   ## Impact
   New Feature/Change: Yes
   User Impact: support delete the DNS server address by index or address
   Build Impact:No new Kconfig options or build system changes.
   Hardware Impact: No
   Security: No
   Compatibility: Backward-compatible; no breaking changes.
   
   ## Testing
   Test process example
   ```
   // Add the first DNS server
   netlib_set_ipv4dnsaddr(&dns1);
   // Add the second DNS server
   netlib_set_ipv4dnsaddr(&dns2);
   // List all DNS servers
   dns_foreach_nameserver(print_dns_callback, &count);
   // Delete DNS server by index
   netlib_del_ipv4dnsaddr_by_index(0);
   // Delete DNS server by address
   netlib_del_ipv4dnsaddr(&dns2);
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] netutils/netlib: support delete the DNS server address by index or address [nuttx-apps]

Posted by "raiden00pl (via GitHub)" <gi...@apache.org>.
raiden00pl commented on PR #3206:
URL: https://github.com/apache/nuttx-apps/pull/3206#issuecomment-3681046048

   @nuttxs hi, dhcpc doesn't compile now when `CONFIG_NETDB_DNSSERVER_NAMESERVERS` is not defined. If this was intended then you need to add `depends on LIBC_NETDB` for dhcpc, if it was not intended then please fix the build.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] netutils/netlib: support delete the DNS server address by index or address [nuttx-apps]

Posted by "nuttxs (via GitHub)" <gi...@apache.org>.
nuttxs commented on PR #3206:
URL: https://github.com/apache/nuttx-apps/pull/3206#issuecomment-3506557300

   The basic documentation update for “netlib” has been completed—please verify it (https://github.com/apache/nuttx/pull/17284/files#diff-a3d43ff48c0c7f39a7306020ac95d948edde9aebb9a3d30cdd13fcdff2d0b206) meets the requirements.  
   As for the compilation errors, I will push update again once PR #17284 (https://github.com/apache/nuttx/pull/17284) is merged.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] netutils/netlib: support delete the DNS server address by index or address [nuttx-apps]

Posted by "nuttxs (via GitHub)" <gi...@apache.org>.
nuttxs commented on PR #3206:
URL: https://github.com/apache/nuttx-apps/pull/3206#issuecomment-3684437986

   > @nuttxs hi, dhcpc doesn't compile now when `CONFIG_NETDB_DNSSERVER_NAMESERVERS` is not defined. If this was intended then you need to add `depends on LIBC_NETDB_DNSCLIENT` for dhcpc, if it was not intended then please fix the build.
   
   @raiden00pl 
   Thank you for identifying the issue.
   When the DNS client is disabled (CONFIG_NETDB_DNSCLIENT is not defined), the DHCP client should not request, parse, or print any DNS-server options.
   I will wrap all DNS-related fields and logic with
   ```
   #if defined(CONFIG_NETDB_DNSCLIENT) && defined(CONFIG_LIBC_NETDB)
   ...
   #endif
   ```
   to resolve the current build issue.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] netutils/netlib: support delete the DNS server address by index or address [nuttx-apps]

Posted by "nuttxs (via GitHub)" <gi...@apache.org>.
nuttxs commented on PR #3206:
URL: https://github.com/apache/nuttx-apps/pull/3206#issuecomment-3690120953

   @acassis @raiden00pl 
   > @nuttxs also, please add an #else warning "CONFIG_NETDB_DNSCLIENT and CONFIG_LIBC_NETDB not define, DNS support is missing"
   Thank you for your valuable suggestions to improve the fix.
   Taking compatibility into account and to keep the fix minimal, PR#3277 should the better choice.
   Please help review — it resolves the “CONFIG_NETDB_DNSSERVER_NAMESERVERS undefined” build error while still preserving the ability to extract and remember the DNS addresses offered by the DHCP server, so the original behaviour remains intact. 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] netutils/netlib: support delete the DNS server address by index or address [nuttx-apps]

Posted by "cederom (via GitHub)" <gi...@apache.org>.
cederom commented on PR #3206:
URL: https://github.com/apache/nuttx-apps/pull/3206#issuecomment-3499410682

   Thanks @xiaoxiang781216 I missed the dependency on https://github.com/apache/nuttx/pull/17284 sorry :-)
   
   @nuttxs please update git commit message to:
   ```
   netutils/netlib: DHCP and DNS related updates.
   
   * new functionality: delete the DNS server address by index or address.
   * Modify the DHCP-client data structure to support multiple DNS addresses.
   * Enhance DHCP-option parsing to extract all DNS-server addresses.
   * Set all received DNS-server addresses.
   
   Signed..
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] netutils/netlib: support delete the DNS server address by index or address [nuttx-apps]

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on PR #3206:
URL: https://github.com/apache/nuttx-apps/pull/3206#issuecomment-3508409973

   @nuttxs please fix the compiler error:
   ```
   ====================================================================================
   Configuration/Tool: stm3240g-eval/discover,CONFIG_ARM_TOOLCHAIN_GNU_EABI
   2025-11-09 10:25:57
   ------------------------------------------------------------------------------------
     Cleaning...
     Configuring...
     Disabling CONFIG_ARM_TOOLCHAIN_GNU_EABI
     Enabling CONFIG_ARM_TOOLCHAIN_GNU_EABI
     Building NuttX...
   chip/stm32_gpio.c:44:11: note: '#pragma message: CONFIG_STM32_USE_LEGACY_PINMAP will be deprecated migrate board.h see tools/stm32_pinmap_tool.py'
      44 | #  pragma message "CONFIG_STM32_USE_LEGACY_PINMAP will be deprecated migrate board.h see tools/stm32_pinmap_tool.py"
         |           ^~~~~~~
   discover_main.c: In function 'discover_main':
   Error: discover_main.c:155:21: error: '(struct in_addr *)&ds.dnsaddr' is a pointer; did you mean to use '->'?
     155 |       if (ds.dnsaddr.s_addr != 0)
         |                     ^
         |                     ->
   Error: discover_main.c:157:34: error: passing argument 1 of 'netlib_set_ipv4dnsaddr' from incompatible pointer type [-Werror=incompatible-pointer-types]
     157 |           netlib_set_ipv4dnsaddr(&ds.dnsaddr);
         |                                  ^~~~~~~~~~~
         |                                  |
         |                                  struct in_addr (*)[1]
   In file included from discover_main.c:37:
   /github/workspace/sources/apps/include/netutils/netlib.h:484:54: note: expected 'const struct in_addr *' but argument is of type 'struct in_addr (*)[1]'
     484 | int netlib_set_ipv4dnsaddr(FAR const struct in_addr *inaddr);
         |                                ~~~~~~~~~~~~~~~~~~~~~~^~~~~~
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] netutils/netlib: support delete the DNS server address by index or address [nuttx-apps]

Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on PR #3206:
URL: https://github.com/apache/nuttx-apps/pull/3206#issuecomment-3499452918

   @nuttxs could you please help to create some basic Documentation about netlib: https://nuttx.apache.org/docs/latest/applications/netutils/netlib/index.html ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] netutils/netlib: support delete the DNS server address by index or address [nuttx-apps]

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on PR #3206:
URL: https://github.com/apache/nuttx-apps/pull/3206#issuecomment-3497587155

   > Thank you @nuttxs :-) Some issues:
   > 
   >     * Build errors, please fix.
   > 
   >     * PR and Commit topic does not match content, it also changes DHCP functionalities, please update (i.e. netutils/netlib: DHCP and DNS related updates. then bullet point changes already there).
   
   https://github.com/apache/nuttx/pull/17284 need be merged first.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] netutils/netlib: support delete the DNS server address by index or address [nuttx-apps]

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 merged PR #3206:
URL: https://github.com/apache/nuttx-apps/pull/3206


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] netutils/netlib: support delete the DNS server address by index or address [nuttx-apps]

Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis commented on PR #3206:
URL: https://github.com/apache/nuttx-apps/pull/3206#issuecomment-3686516219

   > > @nuttxs hi, dhcpc doesn't compile now when `CONFIG_NETDB_DNSSERVER_NAMESERVERS` is not defined. If this was intended then you need to add `depends on LIBC_NETDB_DNSCLIENT` for dhcpc, if it was not intended then please fix the build.
   > 
   > @raiden00pl Thank you for identifying the issue. When the DNS client is disabled (CONFIG_NETDB_DNSCLIENT is not defined), the DHCP client should not request, parse, or print any DNS-server options. I will wrap all DNS-related fields and logic with
   > 
   > ```
   > #if defined(CONFIG_NETDB_DNSCLIENT) && defined(CONFIG_LIBC_NETDB)
   > ...
   > #endif
   > ```
   > 
   > to resolve the current build issue.
   
   @nuttxs also, please add an #else warning "CONFIG_NETDB_DNSCLIENT and CONFIG_LIBC_NETDB not define, DNS support is missing"


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org