[riot-notifications] [RIOT-OS/RIOT] dhcpv6_client: add DNS recursive name server option handling (#16585)

Martine Lenders notifications at github.com
Thu Jun 24 16:03:26 CEST 2021

@miri64 commented on this pull request.

> +
+void dhcpv6_client_dns_rns_conf(const dhcpv6_opt_dns_rns_t *opt, uint16_t netif)
+    if (byteorder_ntohs(opt->len) < sizeof(ipv6_addr_t)) {
+        DEBUG("dhcpv6_client_dns: no DNS recursive name server provided.\n");
+        return;
+    }
+    DEBUG("Overriding sock_dns_server with %s\n",
+          ipv6_addr_to_str(addr_str, opt->dns_rns, sizeof(addr_str)));
+    sock_dns_server.port = SOCK_DNS_PORT;
+    sock_dns_server.family = AF_INET6;
+    sock_dns_server.netif = netif;
+    memcpy(sock_dns_server.addr.ipv6, opt->dns_rns,
+           sizeof(sock_dns_server.addr.ipv6));
+    return;

The idea behind this return is that maybe other DNS client implementations could be added after this.

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210624/4b1f3c61/attachment.htm>

More information about the notifications mailing list