From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 83A4E3D1CB2 for ; Mon, 20 Jul 2026 09:13:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784538822; cv=none; b=txRj7QlazH7mOKYJ02CaymH+TEtTiqiJcsmkEXipWKzShX8GrhfJFyvzKza5KBMbFDcnCZFl9uWZouL6IawgPhChd4F3jPQ0Acu8YzUiUztTA1nnm86219N8TmRxgrhLg7M5WFZHGuKd+J9mvAna5JJXkym9cCisPZOp/CGUhUQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784538822; c=relaxed/simple; bh=85noVtvBLi1tBODpLf1x2bVLhJvsuksgsZFmoemNzgs=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Ns+jTDPN7PA404Iw/TagdWVWnKHEY6bO4wPCVGHAOBOMziWu3VaSiHkqoPLliAmcKzfPtNu/zQkwFei+LweS5nZ/nQayZbxb/b+75UJSLr8OIH+UJ4xzGb5x5ath2CeJ27xoSOx+cII1hx0a02d1795y4IKZxQ2/tNgSSpphUns= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=blackwall.org; spf=none smtp.mailfrom=blackwall.org; dkim=pass (2048-bit key) header.d=blackwall.org header.i=@blackwall.org header.b=homqGH9s; arc=none smtp.client-ip=209.85.221.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=blackwall.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=blackwall.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=blackwall.org header.i=@blackwall.org header.b="homqGH9s" Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-47f752b3423so711252f8f.3 for ; Mon, 20 Jul 2026 02:13:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=blackwall.org; s=google; t=1784538820; x=1785143620; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to:content-type; bh=9T/2cKnEZcfqKCJj5/x/Dfy01VrGSKU7EgzZYtP93MU=; b=homqGH9sMaGDvCLlIBl1C8UwFypei07f8GuLcNbDg1ej5bf6HMNg9GJPnpkp/qdnH1 TCJrrOGogP+4hrvziH/wPfJrOdskYk3dFBiENRXabchZ02KT604K02tc62OpzH2w0kEo xRVy7POOZG5tMl2s6qNRplHWOBISH/1FuQ5jtdxdUY3QS5aSPF1R7CezS3ieEwbc40Z8 fCPGEQvdVqc4hYVoqzyvAZhD96ZWsy1Qm36e22wf/Q8ppexJTT0rgo3IX2hfLXcwMLuW vj5Bf3/nrDIXygnqpV7CTjlWQnsuFAF0r6Z03wsIPwR4K9Wr9AkXPEwkSODAVLFSEpDF +6Ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784538820; x=1785143620; h=content-transfer-encoding:content-type:in-reply-to:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=9T/2cKnEZcfqKCJj5/x/Dfy01VrGSKU7EgzZYtP93MU=; b=PVROn71Jlvr/jbtUrI56HCQuFW/50pgoGbvf/SsfsoE5RFA0t0tH7rnvtuJbgw0UuY Azm5Ow9VI0r9fxms+WAErKfcBrluEOJoJMzoqzSZ2P4FIEiCOK7bdxqMmRQwJNemaQwL Pcraf2ihW2TY2DcomAv61vNlkVIoRg0ay4oDy95xkHbUO6GWk9mFhd+QR+JafvuwJCpm tqNC+TpqCMOPAZESpdu9XrGDCd3m03jEc78DphTODI4qZSH8LYwhfVRtkzP+LzKV5M/a ssuB+rVJwKJLdTPxCVOjmyDwPfLMiIZtDaasl6Nvw8xLCHpOyEoq5ZLaefvGdvVOiCli ZQvg== X-Forwarded-Encrypted: i=1; AHgh+RqoGaKJctIzWXcBA4r6nBzdw1ZY3eQBnIbOd8DyvJgZCPRycUb40v7u4yigsF6M9jrbnInr9SMIgIr51pQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yy8brNVR7CH+Po8o+ADpF4WuK6zgfMsLrOQHzoyWKKjNSt4Uzei QTM4wVdhAKWeXPHJlbFl1MvJUjfVpzGM9d+8AKh0e8Ff9Xfc2K71gg4LgGaeIsKotBo= X-Gm-Gg: AfdE7cm2QLw1XmUK3+y8LBy+buWjGwUNrPEPs6gIGkLpe96rNCF7XK44xXsf2F2E/3A n5hRGCXNRsCQLk9n7rgF2tofkuDQsnyoJIL89HNR2OcEIKI8xKpml5OOFi1qfrjVFgaztRt2Hm2 kQCrjrD5asSJddAz9p2v7+WszrOdnZ2nGVHrrep3Qsd/H6WauxlvEM+gZz9taqv4xPxVCH9NA1N oohAL/c8fcFCkk+cUbELIMaRTmZP56M3msfD/s4o08QjyqJt7D8+/ZhMqnni83VyvTT92PEVa56 H3QMW7FUKT7kSEvOppgRquUtmSoXKcj59AkfKofz4b0N1GnnhCkPKQudrGDaQdi2t/H57L0qLLZ Z8lnCXrgI9AZ92z6JuwJNBvLOVXqRB7qnv+ejlBNJ4kQStCYTap0LXY+U1jYxuxMbIAMXH9fq1x sv30ohnjpXzeSMTlYMo2Xws2sCkCw87bE9 X-Received: by 2002:a05:6000:188f:b0:475:f0c2:5afe with SMTP id ffacd0b85a97d-47f6233b1c9mr16250659f8f.52.1784538819747; Mon, 20 Jul 2026 02:13:39 -0700 (PDT) Received: from [192.168.0.161] (78-154-15-182.ip.btc-net.bg. [78.154.15.182]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47f63ee926dsm26438160f8f.35.2026.07.20.02.13.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 Jul 2026 02:13:39 -0700 (PDT) Message-ID: <2b923c1c-8c00-4375-9ec2-0fa9b073fa91@blackwall.org> Date: Mon, 20 Jul 2026 12:13:38 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next 2/5] ipv6: ndisc: Add ndisc_check_ns_na() validation helper Content-Language: en-US, bg To: Danielle Ratson , netdev@vger.kernel.org Cc: dsahern@kernel.org, idosch@nvidia.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, ja@ssi.bg, petrm@nvidia.com, fw@strlen.de, kuniyu@google.com, bridge@lists.linux.dev, linux-kernel@vger.kernel.org References: From: Nikolay Aleksandrov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 19/07/2026 16:34, Danielle Ratson wrote: > Add ndisc_check_ns_na(), a standalone NS/NA packet validator modeled > after ipv6_mc_check_mld(). It performs the RFC 4861 section 7.1.1 > (Neighbor Solicitation) and 7.1.2 (Neighbor Advertisement) mandatory > checks that are relevant for software operating at the bridge level, > where packets bypass the normal IPv6 stack path: > > - Hop Limit must be 255 (packet was not forwarded by a router) > - ICMPv6 checksum is valid > - ICMP Code is 0 > - ICMP length is at least 24 octets (sizeof(struct nd_msg)) > - Target Address must not be a multicast address > - All included options have a length that is greater than zero > - NS/DAD: destination must be a solicited-node multicast address > - NS/DAD: no Source Link-Layer Address option when source is unspecified > - NA: Solicited flag must be 0 when IP Destination is multicast > > On success the function sets the skb transport header and returns 0, > matching the convention of ipv6_mc_check_mld(). > > Reviewed-by: Petr Machata > Signed-off-by: Danielle Ratson > --- > include/net/ndisc.h | 2 + > net/ipv6/Makefile | 2 +- > net/ipv6/ndisc_snoop.c | 190 +++++++++++++++++++++++++++++++++++++++++ > 3 files changed, 193 insertions(+), 1 deletion(-) > create mode 100644 net/ipv6/ndisc_snoop.c > Acked-by: Nikolay Aleksandrov