From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTP id 5D55A5A026D for ; Tue, 27 Jun 2023 19:18:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687886331; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xbVY4VD42NySEXWCHt3AMPQ+TLmBsQmMZCfh3fYi3Sk=; b=FD+7cJ+kbUUqfaGXRQSnLbpltOMxhehBX3IzT5ujJMeoaMkCMZa9mip0lXGIwpl7UAjdse QYOupwRxvtpKoBIhxnhUTqPDGm93U2oO25EQqOA+RKv4hodL38RiaPg/q7AwjQi5SSbcen k8OGI8z5ON1myK4+2TUbVFZx4K2RuVI= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-614-VHQxpvaXNw2NLgaEEO6z4w-1; Tue, 27 Jun 2023 13:18:49 -0400 X-MC-Unique: VHQxpvaXNw2NLgaEEO6z4w-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 20DD48ED607; Tue, 27 Jun 2023 17:18:49 +0000 (UTC) Received: from elisabeth (unknown [10.39.208.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0FE3B40C6CD1; Tue, 27 Jun 2023 17:18:47 +0000 (UTC) Date: Tue, 27 Jun 2023 19:18:23 +0200 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH] netlink: Use correct interface index in NL_SET mode Message-ID: <20230627191823.053b8903@elisabeth> In-Reply-To: <20230627102233.3114542-1-david@gibson.dropbear.id.au> References: <20230627102233.3114542-1-david@gibson.dropbear.id.au> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: AGP74WFNSMT6LPEJ2OB5GUS7MVVZW44X X-Message-ID-Hash: AGP74WFNSMT6LPEJ2OB5GUS7MVVZW44X X-MailFrom: sbrivio@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 CC: passt-dev@passt.top 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 Tue, 27 Jun 2023 20:22:33 +1000 David Gibson wrote: > nl_addr() and nl_route() take an 'op' selector which affects a number of > parameters to the netlink call. Unfortunately when we introduced this > option a bug was introduced so that we always use the interface index for > the host side, rather than the one for the pasta namespace. Oops, right. Not so luckily, in the tests in my environments, as well as in Podman's CI environment, interface indices actually match... > Really, the entire interface to nl_addr() and nl_route() is pretty bad: > it's tightly coupled with the use cases of its callers. I wouldn't call that specifically a bad thing... with no users, it's, strictly speaking, useless. What's worse in my opinion is the resulting duplication (i.e. each function being specific to *one* caller). I was considering to introduce in that same series a struct representing possible configuration actions, including, say, enum nl_conf { NL_CONF_ADDR, NL_CONF_ROUTE, ... }, but I realised it would be kind of invasive, so I gave up for the moment. > This is a minimal > fix which doesn't address that, but also doesn't make it significantly > worse. > > Bugzilla: https://bugs.passt.top/show_bug.cgi?id=59 > Fixes: 2fe046185634 ("netlink: Add functionality to copy routes from outer namespace") > Fixes: e89da3cf03b2 ("netlink: Add functionality to copy addresses from outer namespace") > > Signed-off-by: David Gibson Applied, thanks. -- Stefano