nuttx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <>
Subject [GitHub] [incubator-nuttx] juniskane commented on a change in pull request #892: Netdb multiple dns servers pr
Date Mon, 27 Apr 2020 06:14:47 GMT

juniskane commented on a change in pull request #892:

File path: libs/libc/netdb/lib_dnsaddserver.c
@@ -198,10 +198,24 @@ int dns_add_nameserver(FAR const struct sockaddr *addr, socklen_t addrlen)
   FAR uint16_t *pport;
   size_t copylen;
+  int nservers;
+  int idx;
-  /* Copy the new server IP address into our private global data structure */
+  /* Get the index of the next free nameserver slot. */
+  dns_semtake();

Review comment:
       Perhaps, but note that the resolv.conf version of the function appends the new nameserver
at the end of the file. It should be changed to match for consistency. I would leave that
to some future PR.
   I think the most common use case is to get DNS1, DNS2,... IPs from operator and then add
entire list by first calling dns_default_nameserver() and then add the DNS1, DNS2, DNS3...
and maybe add some generic fallback server like Google's as *last* in case operator's
preferred servers are down.

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.

For queries about this service, please contact Infrastructure at:

View raw message