Skip to content

Web/REST server does not start in IPv6-only networks #198

Description

@tgroemer

Checklist

  • Checked the issue tracker for similar issues to ensure this is not a duplicate
  • Read the documentation to confirm the issue is not addressed there and your configuration is set correctly
  • Tested with the latest version to ensure the issue hasn't been fixed

How often does this bug occurs?

always

Expected behavior

The ESP Thread Border Router's REST API and Web server should start regardless of the underlying network protocol. It should be fully accessible when either a valid IPv4 address or a routable, non-link-local IPv6 address is assigned.

As smart home and IoT architectures transition to modern protocols, ensuring network stack independence is critical.

Actual behavior (suspected bug)

When only an IPv6 address is assigned, the server never starts.

The HTTP Web/REST server esp_br_web.c only registers handlers for IPv4 address acquisition (IP_EVENT_STA_GOT_IP and IP_EVENT_ETH_GOT_IP). Also, the internal character buffers for storing the IP address are hardcoded to SERVER_IPV4_LEN (16 bytes) which does not fit an IPv6 string representation.

Error logs or terminal output

Steps to reproduce the behavior

  1. Build and flash basic_thread_border_router example using esp-thread-br (commit 66762f2) and ESP-IDF v5.5.4.
  2. Deploy Border Router with IPv6-only connectivity.
  3. Try to access the REST API or Web UI using the device's routable IPv6 address
  4. connection will fail/time out because the web server is not running.

Project release version

66762f2

System architecture

Intel/AMD 64-bit (modern PC, older Mac)

Operating system

Linux

Operating system version

Shell

Bash

Additional context

Proposed solution outline:

  • Increase IP Buffer Sizes
  • Also register for IPv6 IP Events IP_EVENT_GOT_IP6
  • Handle IPv6 events
    • Filter out link-local addresses
    • Verify that the event is for the correct interface
    • If the server has not already started, call start_esp_br_http_server() using the acquired IPv6 address string

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions