Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions libraries/Network/src/NetworkInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,15 @@ bool NetworkInterface::hasGlobalIPv6() const {
bool NetworkInterface::enableIPv6(bool en) {
if (en) {
setStatusBits(ESP_NETIF_WANT_IP6_BIT);
if (_esp_netif != NULL && connected()) {
// If we are already connected, try to enable IPv6 immediately
esp_err_t err = esp_netif_create_ip6_linklocal(_esp_netif);
if (err != ESP_OK) {
log_e("Failed to enable IPv6 Link Local on %s: [%d] %s", desc(), err, esp_err_to_name(err));
} else {
log_v("Enabled IPv6 Link Local on %s", desc());
}
}
} else {
clearStatusBits(ESP_NETIF_WANT_IP6_BIT);
}
Expand Down