Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3B457C7EE22 for ; Mon, 8 May 2023 17:17:14 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D67AC85FE8; Mon, 8 May 2023 19:16:11 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="sKK3fDXY"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E07EB8472A; Mon, 8 May 2023 19:16:09 +0200 (CEST) Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 92F0B8472A for ; Mon, 8 May 2023 19:16:07 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=3Vi5ZZAkKBkEglprulqq1jrrjoh.frpx-errwolvwv.ghq0.gh@flex--dimorinny.bounces.google.com Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-55a1aec6693so80480087b3.1 for ; Mon, 08 May 2023 10:16:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1683566166; x=1686158166; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=cKfktSIGkcx2yiot5x4fmTw0uXf3lZzp2TCmaMfGs2c=; b=sKK3fDXYEITYXom+h87dUgwiC5f9/Hu1wWgP/d8xsRRa1yXuXUkODvCOJuRIqxLnfa VRxmeo7H/wcWjNTfaHdQyjNCWgV/ugz+MvyEl8LQk/oZd1kW016jONYEEHPJJtRa1fhY lIeWEAWpmY91C8YDbx8sRHYVY13MWbWWVKZp/FPChO2v2M/6pgoF7FWJOgNMMET9kWtb TqNE/0B+hAQPS19KeidLzfx5f88j8OGKp5OxE7EEulgVq1WTRlceFnZXLSUsxwt3Fip7 Zegq1QMa1YP1wOTwWLQuMZxUiF4TI81l/Svs6+JleHg3ZKghovVSG5cDu/8ybDWC1xhW t+pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683566166; x=1686158166; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=cKfktSIGkcx2yiot5x4fmTw0uXf3lZzp2TCmaMfGs2c=; b=j9GJJyIIXmnk9z1GAh1xjjAbeyOC5SrEB83/YcHk0OFu9uLT+g/lMGgTgL6DbWxADY YOMoaM+dWzxSPuujvMGwmQgOfjuCb3zVRqtKONbRRK3hK3tMjYQAu0G+k2TUhi3skta1 nGTYmzQ4AWgM8RsY9CpE7oBmAE5tHS3C3N8cUS+pUXPkUE3tKUPZMnbC5KxlqVpypOmJ BbAH3AoI3IINSp2b5R0IA5kEbXYqtG/HgzHYQruCTkjIuJy5mA5E1iwqWrDVVrun6CDF 1RyNk6RHB5o1LYBk+nIe4Z2Yw5UVbjhHw9Dc1Lnepl8lST0/oMfRUD439eeYBnvDh7Dy F4pQ== X-Gm-Message-State: AC+VfDwSejuIkGGT53FeEZ0FHbn3BIRvtDenVPUz2305a8cnHVZGUB4s WhnyzRS3JrzuyCMWo81ynPwNbiJVOSDwXtvlYIRPgJlVmQuq5qnlGUGpMhRbhIjJJOTWWi4navn X2/4j4wd/+iYZMIxHsL7ja3DITxZsEvrQAKMifzTy/DRZqlshZf5HFwh5MwnhoIy+Fak= X-Google-Smtp-Source: ACHHUZ5oHGMbRAbRTlZaNURF/scfkBJ5cW1T+qVOD7QEUHzhj2hoskOvnpePPK41mfvM08yMxmSzCldMyOrhivM= X-Received: from dimorinny0.lon.corp.google.com ([2a00:79e0:d:209:f357:b9b:9cec:e681]) (user=dimorinny job=sendgmr) by 2002:a81:a9c5:0:b0:556:2da0:fb8 with SMTP id g188-20020a81a9c5000000b005562da00fb8mr6570116ywh.7.1683566166327; Mon, 08 May 2023 10:16:06 -0700 (PDT) Date: Mon, 8 May 2023 18:15:25 +0100 In-Reply-To: <20230508171525.1082432-1-dimorinny@google.com> Mime-Version: 1.0 References: <20230508171525.1082432-1-dimorinny@google.com> X-Mailer: git-send-email 2.40.1.521.gf1e218fcd8-goog Message-ID: <20230508171525.1082432-6-dimorinny@google.com> Subject: [PATCH 6/6] net: update net_ip6 from link_local address when eth device is changed From: Dmitrii Merkurev To: u-boot@lists.denx.de Cc: rammuthiah@google.com, Dmitrii Merkurev , Ying-Chun Liu , Simon Glass Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean 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 Cc: Ying-Chun Liu (PaulLiu) Cc: Simon Glass =D0=A1=D1=81: Joe Hershberger =D0=A1=D1=81: Ramon Fried --- 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) =20 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 --=20 2.40.1.521.gf1e218fcd8-goog