Skip to content

Use IPv6 Router Advertisement options for DNS configuration (RFC 8106) #7798

Open
@MarcusWichelmann

Description

@MarcusWichelmann

Basic Infos

  • This issue complies with the issue POLICY doc.
  • I have read the documentation at readthedocs and the issue is not addressed there.
  • I have tested that the issue is present in current master branch (aka latest git).
  • I have searched the issue tracker for a similar issue.
  • If there is a stack dump, I have decoded it.
  • I have filled out all fields below.

Platform

  • Hardware: ESP-12
  • Core Version: 2.7.3-3-g2843a5ac
  • Development Env: Platformio
  • Operating System: Fedora

Settings in IDE

  • Module: Generic ESP8266 Module
  • Flash Size: 4MB
  • lwip Variant: IPv6+STABLE-2_1_2_RELEASE
  • Reset Method: manual
  • Upload Using: serial

Problem Description

When connecting the ESP to an ipv6 enabled WiFi network with a router, that sends the RDNSS option in its router advertisements, the received DNS server is not respected and not visible when querying WiFi.dnsIP(). This feature is supported by lwIP, but seems to be disabled:

#define LWIP_ND6_RDNSS_MAX_DNS_SERVERS 0 // 0

MCVE Sketch

#include <Arduino.h>
#include <ESP8266WiFi.h>

void setup()
{
  Serial.begin(74880);
  Serial.setDebugOutput(ENABLE_DEBUG);
  Serial.println(ESP.getFullVersion());

  WiFi.mode(WIFI_STA);
  WiFi.hostname(SYSTEM_HOSTNAME);
  WiFi.begin(WIFI_STA_SSID, WIFI_STA_PASSWORD);

  // Wait for IPv4 & IPv6 addresses other than link-local
  bool hasV4 = false, hasv6 = false;
  while (!hasV4 || !hasv6)
  {
    for (auto entry : addrList)
    {
      IPAddress addr = entry.addr();
      if (addr.isLocal())
        continue;

      if (!hasV4)
        hasV4 = addr.isV4();
      if (!hasv6)
        hasv6 = addr.isV6();
    }

    Serial.print('.');
    delay(500);
  }

  Serial.println();

  // Print dns server list
  Serial.print("DNS servers:");
  for (int i = 0; i < DNS_MAX_SERVERS; i++)
  {
    IPAddress dns = WiFi.dnsIP(i);
    if (dns.isSet())
      Serial.printf(" %s", dns.toString().c_str());
  }
  Serial.println();
}

void loop()
{
}

Debug Messages

SDK:2.2.2-dev(38a443e)/Core:2.7.3-3-g2843a5ac=20703003/lwIP:IPv6+STABLE-2_1_2_RELEASE/glue:1.2-30-g92add50/BearSSL:5c771be
....
DNS servers: 192.168.11.1 // <-- Here I would expect the IPv6 DNS server, too.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions