From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=fail (p=quarantine dis=none) header.from=redhat.com Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTPS id EA63D5A0269 for ; Thu, 03 Dec 2026 20:37:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1796326638; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=39qldMp2MgHIoImYNm+r9pcBFiaqRYsuEnI5YrGf0lE=; b=AUVlzeyAeO8uhQJGwxi/Dola2I21vuS6kk7/VtfzUaxtvXatUdGD+6yJORUe/evIlYKuXO gPDUNK5VUieU56tpJd12tZY7/oBgwYkeeK1+fpYXjozVT6PEu6LL6tSGQ88O+lDP54hFaI qDYammZCsXxLXGX1HhynV0Hz0mAmm9Q= X-MC-Rep: binary re single Received: from mail-dy1-f198.google.com (mail-dy1-f198.google.com [74.125.82.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-217-gsj6e7diNPOcRCqu8IPQog-1; Thu, 3 Dec 2026 19:37:16 +0000 X-MC-Unique: gsj6e7diNPOcRCqu8IPQog-1 X-Mimecast-MFC-AGG-ID: gsj6e7diNPOcRCqu8IPQog_1796326635 Received: by mail-dy1-f198.google.com with SMTP id 5a478bee46e88-3875029077eso337271eec.0 for ; Thu, 03 Dec 2026 11:37:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796326635; x=1796931435; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:to: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=39qld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4mXS dkBaGPmYMqBXta3BsqQQg24bYfS8rPjI2beqfo7HLyJsakeiRUvyFJeIHdkwtOIyVirKWd1vKTb c2AapNbA303pRpBgGsnR/kCp0/Nkn7sfy46QSQIYo= X-Received: by 2002:a05:693c:80ce:b0:36a:12c1:3adb with SMTP id 5a478bee46e88-3856f254a24mr45504210eec.20.1796326635321; Thu, 03 Dec 2026 11:37:15 -0800 (PST) X-Received: by 2002:a05:693c:80ce:b0:36a:12c1:3adb with SMTP id 5a478bee46e88-3856f254a24mr45504180eec.20.1796326634414; Thu, 03 Dec 2026 11:37:14 -0800 (PST) Received: from [192.168.2.15] (lnsm6-montreal02-142-122-43-105.internet.virginmobile.ca. [142.122.43.105]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-38707b612cbsm81172573eec.4.2026.12.03.11.37.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 03 Dec 2026 11:37:14 -0800 (PST) Message-ID: <8d80cd4a-5b4d-487c-9af6-1f7b25d60454@redhat.com> Date: Thu, 3 Dec 2026 14:37:10 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] netlink: Only consider gateway from the selected template interface To: Benjamin Schubert , "passt-dev@passt.top" References: <2UuogkMNAhFH_0bGAADpm7VgzMi123uydmdNZpZZ6tWdhkxB8y5S4Z4h4Ela1Vyb0QymFQg2Pe03CsvEWjLtdvbeFhbCuBJthILFuMs-JYo=@benschubert.me> From: Jon Maloy In-Reply-To: <2UuogkMNAhFH_0bGAADpm7VgzMi123uydmdNZpZZ6tWdhkxB8y5S4Z4h4Ela1Vyb0QymFQg2Pe03CsvEWjLtdvbeFhbCuBJthILFuMs-JYo=@benschubert.me> X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: ztmJcpnGEkhx83dVsQGWv1nKYrW-CzT1EgayzGPfSow_1796326635 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Message-ID-Hash: 4SSU6ZBZTB63SLC4KRXAIOR7OE4FABZ5 X-Message-ID-Hash: 4SSU6ZBZTB63SLC4KRXAIOR7OE4FABZ5 X-MailFrom: jmaloy@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On 2026-12-03 10:12, Benjamin Schubert wrote: > From: Benjamin Schubert > [...] > This considers only nexthops from the current interface instead of all > interfaces when looking at the template interface, ensuring that the ip > and the gateway are always aligned. The change looks correct to me. A couple of comments: - passt.1 still says that, for a multipath default route, "the gateway is the first nexthop router returned by the kernel which has the highest weight in the set of paths". With this change, it's the highest-weight one on the template interface, so I think the man page should be updated accordingly. - Alternatively, nl_get_ext_if() could pick the template interface from the highest-weight nexthop instead of the first one, which would keep the documented behaviour. I'm fine with either, maybe Stefano has a preference. > > Link: https://bugs.passt.top/show_bug.cgi?id=232 > Signed-off-by: Benjamin Schubert > --- > netlink.c | 8 +++-- > test/pasta_options/multipath_gateway | 46 ++++++++++++++++++++++++++-- > 2 files changed, 50 insertions(+), 4 deletions(-) > > diff --git a/netlink.c b/netlink.c > index 37c55cc..f7bc7ab 100644 > --- a/netlink.c > +++ b/netlink.c > @@ -362,26 +362,30 @@ unsigned int nl_get_ext_if(int s, sa_family_t af) > } > > /** > * nl_route_get_def_multipath() - Get first highest-weight route from nexthop list > * @rta: Routing netlink attribute with type RTA_MULTIPATH > + * @ifi: Interface index > * @gw: Default gateway to fill > * > * Return: true if a gateway was found, false otherwise > */ > -static bool nl_route_get_def_multipath(struct rtattr *rta, void *gw) > +static bool nl_route_get_def_multipath(struct rtattr *rta, unsigned int ifi, void *gw) This line exceeds 80 columns. > { > int nh_len = RTA_PAYLOAD(rta); > struct rtnexthop *rtnh; [...] > +def ipv4_other_interface > +ipv4 > +set OTHER_PREFIX 192.51.100. I guess you meant 198.51.100. (TEST-NET-2, RFC 5737): 192.51.100.0/24 is regular address space. > +set OTHER_INTERFACE_SETUP ip link add dummy1 type dummy; ip link set dummy1 up; ip -4 address add __OTHER_PREFIX__10/24 dev dummy1 > +endef > + [...] > +set NEXTHOPS nexthop via __OTHER_PREFIX__1 dev dummy1 weight 3 nexthop via __PREFIX__1 dev dummy0 weight 1 > +set EXPECTED __PREFIX__1 > +check_gateway Nit: a Fixes: tag for 6c7623d0 ("netlink: Add support to fetch default gateway from multipath routes") would be nice, as that's where we started picking the gateway from any nexthop, including ones on interfaces other than the template interface. ///jon