You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/08/12 17:09:13 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 commented on a diff in pull request #6841: dns_client: directly initialize g_dns_servers and remove dns_initialize directly

xiaoxiang781216 commented on code in PR #6841:
URL: https://github.com/apache/incubator-nuttx/pull/6841#discussion_r944657295


##########
libs/libc/netdb/lib_dnsaddserver.c:
##########
@@ -45,8 +45,41 @@
 #ifndef CONFIG_NETDB_RESOLVCONF
 /* The DNS server addresses */
 
-union dns_addr_u g_dns_servers[CONFIG_NETDB_DNSSERVER_NAMESERVERS];
-uint8_t g_dns_nservers;    /* Number of currently configured nameservers */
+union dns_addr_u g_dns_servers[CONFIG_NETDB_DNSSERVER_NAMESERVERS] =
+  {
+#if defined(CONFIG_NETDB_DNSSERVER_IPv4)
+    {
+      .ipv4.sin_family      = AF_INET,

Review Comment:
   It's very hard to keep C89 since g_dns_servers's type is union.



-- 
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