From mboxrd@z Thu Jan 1 00:00:00 1970 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 578EBC77B7C for ; Fri, 5 May 2023 14:13:23 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 57A26846B0; Fri, 5 May 2023 16:13:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="HgtfcVak"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 16C398472D; Fri, 5 May 2023 16:13:20 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by phobos.denx.de (Postfix) with ESMTP id 787578469B for ; Fri, 5 May 2023 16:13:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=emohandesi@linux.microsoft.com Received: from [192.168.0.169] (c-73-183-134-76.hsd1.tx.comcast.net [73.183.134.76]) by linux.microsoft.com (Postfix) with ESMTPSA id 0CCE920EA272; Fri, 5 May 2023 07:13:14 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 0CCE920EA272 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1683295996; bh=8VLuckNyh0U85x9zZCKLHN/XvQD6ePfOBh4vesx8H3g=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=HgtfcVaktaq5yH3FqPis2FhoS5QkTYEyU69rlpKRyxYfqO2ux5p2sRJKIVx2qmgyH OK1HdVHDWAhL1D4ic9qsZKpCZcZCvkMpIreaff0ASaQ1mjgoQy1yxIHh3aSNtQqCsk TtzcDZ9yQdQBzNHbHas30yYsTkzM4OAMWn/qVAbM= Message-ID: <306f4064-77cc-0f4d-84fc-3c421da11669@linux.microsoft.com> Date: Fri, 5 May 2023 09:13:13 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: [PATCH v4 1/3] net: ipv6: Add support for default gateway discovery. To: Sergei Antonov Cc: u-boot@lists.denx.de, sjg@chromium.org, mario.six@gdsys.cc, joe.hershberger@ni.com, rfried.dev@gmail.com, xypron.glpk@gmx.de, ilias.apalodimas@linaro.org, masahisa.kojima@linaro.org, pali@kernel.org, tobias@waldekranz.com, john@metanate.com, v.v.mitrofanov@yadro.com References: <1677776290-11067-1-git-send-email-emohandesi@linux.microsoft.com> <1682122103-21466-1-git-send-email-emohandesi@linux.microsoft.com> <1682122103-21466-2-git-send-email-emohandesi@linux.microsoft.com> Content-Language: en-US From: Ehsan Mohandesi In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.39 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 On 5/4/2023 9:52 AM, Sergei Antonov wrote: > On Sat, 22 Apr 2023 at 03:08, wrote: > >> + if (prefix->on_link && ntohl(prefix->valid_lifetime)) { >> + net_prefix_length = prefix->prefix_len; >> + net_gateway6 = ip6->saddr; >> + return 0; > Is it OK that prefix->prefix_len is used, but prefix->prefix is not? > Just curious. prefix->prefix is used just before this if statement to make sure it is not a link-local address as shown below. if((ntohs(prefix->prefix.s6_addr16[0]) & IPV6_LINK_LOCAL_MASK) == IPV6_LINK_LOCAL_PREFIX) break; if(prefix->on_link && ntohl(prefix->valid_lifetime)) { net_prefix_length = prefix->prefix_len; net_gateway6 = ip6->saddr; return0; }