From owner-freebsd-net@freebsd.org Wed Oct 2 23:12:32 2019 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BB94513BA85 for ; Wed, 2 Oct 2019 23:12:32 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46kBk70xCKz4748 for ; Wed, 2 Oct 2019 23:12:30 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by mail-io1-xd33.google.com with SMTP id v2so1173121iob.10 for ; Wed, 02 Oct 2019 16:12:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=IcB3NivqJcssdZRW9eu6y9XW0H0y0kaPBHBFEtM0WR4=; b=s93rrW2Y+77MuJ1YgaJKp9eFVyavN0ms+3DpnpPYZxvniUsIp80dxAcZ30yD6SE+JP IZql1qiu/ftPoSY4K+LMRjp7ClV7vZG/9QxbyNFx2Qw3vcj48cMYNeiDTZFktHu+dPot O0qSmUtYcs67eiuB0d0xBcSVRDj5xPTu2oClRs4OUOUVzM+1s7S7kxP5tfwVi7Os6lyv Ph/MbeRC8AvWvxSMstJMCYdvlf7/VPyYPQrAyhESAEw3jL/kVoAt1Lrs9ZGXXATsDben VcJ2bN52cDOJe5pN2wG150EKFI39XcDDvpG82kPla3YkJ5MWsuuYTPeN12Hbn5iusQm5 I2xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=IcB3NivqJcssdZRW9eu6y9XW0H0y0kaPBHBFEtM0WR4=; b=DvtFAwjIE5h6LPyP4i2VtJOHi1mCCHcBTUtcXUbRi+RbOhA9l9q8YG59SEJ5W7X66x k7PZow10JjHo5VmftwdkD8wVp4nIOeYcx3SQYD3r9THpjZEz7kxmafcrxfS7ylMUI34a DZp9zy9dZD5daW9nTtBTu5Ro1K/6XeSbb/GBb1bZzl0SWxhVEvsvHNcPgHKrkFX/A5CM GKL0hkx5999ijnxgIAYoIo74vjaqdWD1+iPJeaUI04TqbiG0obhYEkHujdFfW8iO+pgZ MitA68M0UscAYQ8lWY2BcNUX6OLdbyeIUqixbwu1HtkJfQhcNmD/+t504DutGOr5yfyP qcMg== X-Gm-Message-State: APjAAAUi0dxgKROSjJXpXN44jt2gEefMh6BZJ7+RqTV7wbRpeUqcvtQG paxle7L3GYzm5siWBquj3lrQv9ha X-Google-Smtp-Source: APXvYqwS7Y/7z2gsBas1EXRi32k1aib4X53D/geR5PXZIs5u+PXatW4GQdFieiKIWXftgGmiH2IijA== X-Received: by 2002:a02:ce2b:: with SMTP id v11mr6549817jar.134.1570057948617; Wed, 02 Oct 2019 16:12:28 -0700 (PDT) Received: from [25.81.26.0] ([209.171.88.0]) by smtp.gmail.com with ESMTPSA id 26sm493318ilx.47.2019.10.02.16.12.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Oct 2019 16:12:27 -0700 (PDT) Mime-Version: 1.0 (1.0) Subject: Re: IPv6: Invalid nd6 entry created for an RA without an lladdr From: Ryan Stone X-Mailer: iPhone Mail (16G102) In-Reply-To: Date: Wed, 2 Oct 2019 19:12:26 -0400 Cc: freebsd-net Message-Id: References: To: =?utf-8?B?56We5piO6YGU5ZOJ?= X-Rspamd-Queue-Id: 46kBk70xCKz4748 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=s93rrW2Y; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of rysto32@gmail.com designates 2607:f8b0:4864:20::d33 as permitted sender) smtp.mailfrom=rysto32@gmail.com X-Spamd-Result: default: False [-1.50 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MV_CASE(0.50)[]; URI_COUNT_ODD(1.00)[3]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RECEIVED_SPAMHAUS_PBL(0.00)[0.88.171.209.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-net@freebsd.org]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[3.3.d.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; IP_SCORE(0.00)[ip: (-4.33), ipnet: 2607:f8b0::/32(-2.57), asn: 15169(-2.16), country: US(-0.05)]; RCVD_TLS_ALL(0.00)[] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2019 23:12:32 -0000 Ah, that=E2=80=99s my mistake. I originally saw the issue on an older FreeBS= D release and missed that the code had changed subtly when I looked up the v= ersion in head. r328552 fixed this issue already Thanks for the sanity check.=20 Sent from my iPhone > On Oct 2, 2019, at 6:51 PM, =E7=A5=9E=E6=98=8E=E9=81=94=E5=93=89 wrote: >=20 > At Wed, 2 Oct 2019 17:04:23 -0400, > Ryan Stone wrote: > >=20 > > At work, our product is putting through an IPv6 conformance test and > > it's found an issue in our handling of Routing Advertisements (RAs). > > If we receive an RA that does not specify an lladdr, then > > nd6_cache_lladdr() is called with lladdr NULL: > >=20 > > https://svnweb.freebsd.org/base/head/sys/netinet6/nd6.c?revision=3D34798= 4&view=3Dmarkup#l1961 > >=20 > > In this case, the linkhdr cache is never initialized, but we still put > > the entry in the STALE state at line 2032. >=20 > If lladdr is NULL shouldn't it reach line 2032? >=20 > if (lladdr !=3D NULL) { /* (7) */ > nd6_llinfo_setstate(ln, ND6_LLINFO_STALE); > EVENTHANDLER_INVOKE(lle_event, ln, > LLENTRY_RESOLVED); > } >=20 > In any case, if a host receives an RA without a link-layer address > option and no neighbor cache entry exists for the RA sender at that > point, it shouldn't set the state of a newly created cache entry to > STALE. While RFC4861 is not so explicit about this particular > condition, I believe it's pretty clear from Section 6.3.4 of the RFC > (it may even be questionable just to create an entry in this case, but > that's probably within the scope of acceptable implementation choices > as long as the entry is a mere placeholder). I also believe FreeBSD > used to not do this (correctly), so if it currently sets it to STALE > it's quite likely to be some regression. >=20 > -- > JINMEI, Tatuya