Fri 06 May 2016 07:32:42 PM UTC, original submission:
I would like to implement network reconfiguration on the fly without restarting whole MCU.
Imagine two modes - autoconfiguration and static IP configuration.
After changing from one mode to another, I don't want old addresses to persist I do following steps
netif_set_down(netif);
foreach(ip6_addr) {
netif_ip6_addr_set(netif, i, IP6_ADDR_ANY6);
netif_ip6_addr_set_state(netif, i, IP6_ADDR_INVALID);
}
netif_create_ip6_linklocal_address(netif, 1);
netif->ip6_autoconfig_enabled = MODE;
netif_set_up(netif);
But after performing these steps twice with MODE=1, no autoconfiguration address is assigned after second run.
After some investigation I found, that there is missing something like nd6_cleanup_netif in netif_set_down
After implementing it and calling it from netif_set_down, it starts working.
In the attachement, there is simple implementation of nd6_cleanup_netif. I may not be correct in handling of default_route cleanup.
|