From nobody Sun Oct 5 05:03:22 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cfVfP4cT7z6BZKt; Sun, 05 Oct 2025 05:03:25 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfVfP3j54z43jD; Sun, 05 Oct 2025 05:03:25 +0000 (UTC) (envelope-from glebius@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759640605; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=IZ4cHBMOIXAeKLfhVKXhj0VJSEnNQJSRtK+9fiG6JDc=; b=wzJBW0bQPkSn2MAG1dMCB7ta5W3B5B4QS5AJA/Ik/VfsBmAOJeyT/tyvqDty7/q65cyaNo FhgqMfxDnCDYMMxQFi62OEcb66VcuVjMwqnQyA+4mwcn3w2biqKVdXSE1QYisuBX3f5Xsy sEsXHPC42zwVoOEg0YoOIPNtFzcMw2OPDp/aEVjptTCUBaXwbgoKUr5x8ulVRKIak5ZV5u w2K0/nytzD7t5oMX5yUavzYoJisCHrpg2M/D7kPbOS+5rV7EvBayT1oeQh8L92baU+NcZj aitWiq9hG//c1AW8Us97sxtK/YOteF+ewZorT7P3+5PJXf67zxqdoH0Bv8csXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759640605; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=IZ4cHBMOIXAeKLfhVKXhj0VJSEnNQJSRtK+9fiG6JDc=; b=aqLp/htOxmmlMZS8rAeAJXnwg4IyvCm1uPs+cl3Eaqdxq9LcXTlMax572U6o7Lvh4WTjX4 R8CriBObf957cjQgnhBunHOPsmvF6KvIix8LEcsNLX6HoSdtbupd2KNB2XiKdv48i7D9Jf a5knLNWIXZqKFwg7Q9R2jVI9F7RTRLKzTk1v9X9m6E7NKJaUHeBZkCUky2xX3q7kiZyRg/ 1fhnJQn/70f6LfyQRmfLXlQL3Jrp8eb9QWLQKnSKpd6WVuvgX8TJ43OUfH9ZGmWXM7sD8v dcscyBodGeBClji/kJmLtUw8MgU0LDaaqwi9VtzWV7BWZGINb5/wdrf+PgpkZQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759640605; a=rsa-sha256; cv=none; b=wXPGu4Tdbzk5PalV/S8ga5lYIiRG0hM5tfl6actxsX1Sdl+/NX9VZZqizmpixMIIsNXjIv uaEBdUywHABucYe8x+9UhujLHHmhfg8z/5gjnymarOxgBAfvmkcCbShWXt6Ike42IS9/CE uuTn8hY0+4Em1so70uf4Vj034exUKoaoJlFqtfHXN9xKAtrB2AEmTOodZHm4n98qLVU+DR 5HIrmxkO+0c2ndpkLjknnKXEaqXwkA5fYBxtJG5X9UxdOm6Csl90f+VNdDQ9dGSUVzmsVe SkCa2eLCCaYnJMUMR6ceMEcbRlWi/cKZ+ZkaAJCvxEDHoTln0p9Qz78V7+MwaA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: glebius) by smtp.freebsd.org (Postfix) with ESMTPSA id 4cfVfN5wX4z17BB; Sun, 05 Oct 2025 05:03:24 +0000 (UTC) (envelope-from glebius@freebsd.org) Date: Sat, 4 Oct 2025 22:03:22 -0700 From: Gleb Smirnoff To: "Andrey V. Elsukov" , kp@freebsd.org Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 716acd9367df - main - carp6: revise the generation of ND6 NA Message-ID: References: <202510030802.59382PmL063849@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202510030802.59382PmL063849@gitrepo.freebsd.org> On Fri, Oct 03, 2025 at 08:02:25AM +0000, Andrey V. Elsukov wrote: A> static void A> carp_send_na(struct carp_softc *sc) A> { A> - static struct in6_addr mcast = IN6ADDR_LINKLOCAL_ALLNODES_INIT; A> struct ifaddr *ifa; A> - struct in6_addr *in6; A> + int flags; A> A> + /* A> + * Sending Unsolicited Neighbor Advertisements A> + * A> + * If the node is a router, we MUST set the Router flag to one. A> + * We set Override flag to one and send link-layer address option, A> + * thus neighboring nodes will install the new link-layer address. A> + */ A> + flags = ND_NA_FLAG_OVERRIDE; A> + if (V_ip6_forwarding) A> + flags |= ND_NA_FLAG_ROUTER; A> CARP_FOREACH_IFA(sc, ifa) { A> if (ifa->ifa_addr->sa_family != AF_INET6) A> continue; A> - A> - in6 = IFA_IN6(ifa); A> - nd6_na_output(sc->sc_carpdev, &mcast, in6, A> - ND_NA_FLAG_OVERRIDE, 1, NULL); A> - DELAY(1000); /* XXX */ A> + /* A> + * We use unspecified address as destination here to avoid A> + * scope initialization for each call. A> + * nd6_na_output() will use all nodes multicast address if A> + * destinaion address is unspecified. A> + */ A> + nd6_na_output(sc->sc_carpdev, &in6addr_any, IFA_IN6(ifa), A> + flags, ND6_NA_OPT_LLA | ND6_NA_CARP_MASTER, NULL); A> + DELAY(1000); /* RetransTimer */ A> } A> } Not really related to the change, but since the change preserved the DELAY(), asking as a reply to the change. This function is executed in callout(9) context, so we are stopping the callout thread, that otherwise could be servicing other tasks, for 1000 microseconds per address that is being redundant under same VHID. This DELAY() comes all the way from original import from OpenBSD. Is there any specification in IPv6 that prevents us from quickly sending a bunch of different NAs? I see that nd6_na_output_fib() has comments above: * Based on RFC 2461 * * the following items are not implemented yet: * - proxy advertisement delay rule (RFC2461 7.2.8, last paragraph, SHOULD) * - anycast advertisement delay rule (RFC2461 7.2.7, SHOULD) Is this related to that or not? -- Gleb Smirnoff