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 1B4685A026D for ; Wed, 23 Aug 2023 17:25:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1692804305; 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=D7wVNHnbWqpnQ9mtuH9mIFWnRcv87k75JxN6kma1AA8=; b=IZgRnnnHHD0lsk7S7BHMS/r8MF9QPzzulaZiJ+YCJx5IFdKFvw2nZoTy7PZU3omSPZC8gd hFG6ZCl5zRSAEVK9GFOaKb9z/OECId3HMsHLhMrk0L+/AqeEULTq9nscu/+moKW0juwJim WBmF5DIrfrnBOswNaYTnNxkFvAiU2Ic= Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-230-g5R2uBRTMkCcGEO3FDBS1A-1; Wed, 23 Aug 2023 11:25:00 -0400 X-MC-Unique: g5R2uBRTMkCcGEO3FDBS1A-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 695AE3811F34; Wed, 23 Aug 2023 15:25:00 +0000 (UTC) Received: from elisabeth (unknown [10.39.208.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B14E5492C14; Wed, 23 Aug 2023 15:24:59 +0000 (UTC) Date: Wed, 23 Aug 2023 17:24:57 +0200 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH] pasta: Strip RTA_PREFSRC when copying routes to the namespace Message-ID: <20230823172457.732333d4@elisabeth> In-Reply-To: <20230823070338.1546174-1-david@gibson.dropbear.id.au> References: <20230823070338.1546174-1-david@gibson.dropbear.id.au> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: DFFF5NHD6WZN3GULSBWETPIEIJFPHMGC X-Message-ID-Hash: DFFF5NHD6WZN3GULSBWETPIEIJFPHMGC 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 Wed, 23 Aug 2023 17:03:38 +1000 David Gibson wrote: > Host routes can include a preferred source address (RTA_PREFSRC), which > must be one of the host's addresses. However when using pasta with -a the > namespace might be given a different address, not on the host. This seems > to occur pretty routinely depending on the network configuration systems > in place on the host. > > With --config-net we will try to copy host routes to the namespace. If > one of those includes an RTA_PREFSRC, but the namespace doesn't have the > host address, this will fail with -EINVAL, causing pasta to fail. > > Fix this by stripping off RTA_PREFSRC attributes from routes as we copy > them to the namespace. This is by no means infallible, bit it should at > least handle common cases for the time being. > > Link: https://bugs.passt.top/show_bug.cgi?id=71 > Link: https://github.com/containers/podman/pull/19699#issuecomment-1688769287 > > Signed-off-by: David Gibson Applied. -- Stefano