Current active eth device may be changed (due to ethprime), so make sure current net_ip6 is updated as a reaction.
Signed-off-by: Dmitrii Merkurev <[email protected]> Cc: Ying-Chun Liu (PaulLiu) <[email protected]> Cc: Simon Glass <[email protected]> Сс: Joe Hershberger <[email protected]> Сс: Ramon Fried <[email protected]> --- net/net.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/net.c b/net/net.c index 3fc6681898..a52c110d93 100644 --- a/net/net.c +++ b/net/net.c @@ -359,10 +359,10 @@ static int net_init_loop(void) if (IS_ENABLED(CONFIG_IPV6)) { ip6_make_lladdr(&net_link_local_ip6, net_ethaddr); - if (!memcmp(&net_ip6, &net_null_addr_ip6, - sizeof(struct in6_addr))) - memcpy(&net_ip6, &net_link_local_ip6, - sizeof(struct in6_addr)); + if (memcmp(&net_link_local_ip6, &net_null_addr_ip6, + sizeof(struct in6_addr))) { + net_copy_ip6(&net_ip6, &net_link_local_ip6); + } } } else -- 2.40.1.521.gf1e218fcd8-goog

