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 1177C5A0272 for ; Thu, 9 Mar 2023 03:42:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678329775; 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=NeoEa89J3T+fq3ek7YhKcRmsL8/A1Kc2XIKrh6Z1Wj8=; b=gBmRcCcLYrT/9yjOClhOmO2boYn3CJOc5q+ZYCq8ZJCtQjfymsOanIMl00iEAQFE2rysA8 x7XMpGodrzL1VKTN3lz/RSmFHvkOhC8eY4G/Jrp703iP6rw7EUfiFz0AgQcUtde/c8SRYO eI888aDZ0CxIlnlNpyBz6f6Qwg2ge8g= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [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-94-U50KTRggNT6r5x1ElJg5bQ-1; Wed, 08 Mar 2023 21:42:53 -0500 X-MC-Unique: U50KTRggNT6r5x1ElJg5bQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8C41C3C0CD51; Thu, 9 Mar 2023 02:42:53 +0000 (UTC) Received: from maya.cloud.tilaa.com (unknown [10.33.32.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 63D712166B26; Thu, 9 Mar 2023 02:42:53 +0000 (UTC) Date: Thu, 9 Mar 2023 03:42:42 +0100 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH v4 2/2] conf, icmp, tcp, udp: Add options to bind to outbound address and interface Message-ID: <20230309034242.75d98d48@elisabeth> In-Reply-To: References: <20230309020947.2609964-1-sbrivio@redhat.com> <20230309020947.2609964-3-sbrivio@redhat.com> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: BFHOWQIONM2MEDAF7T4VWZ7XLTIY3LN2 X-Message-ID-Hash: BFHOWQIONM2MEDAF7T4VWZ7XLTIY3LN2 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 Thu, 9 Mar 2023 13:31:19 +1100 David Gibson wrote: > On Thu, Mar 09, 2023 at 03:09:47AM +0100, Stefano Brivio wrote: > > I didn't notice earlier: libslirp (and slirp4netns) supports binding > > outbound sockets to specific IPv4 and IPv6 addresses, to force the > > source addresse selection. If we want to claim feature parity, we > > should implement that as well. > > > > Further, Podman supports specifying outbound interfaces as well, but > > this is simply done by resolving the primary address for an interface > > when the network back-end is started. However, since kernel version > > 5.7, commit c427bfec18f2 ("net: core: enable SO_BINDTODEVICE for > > non-root users"), we can actually bind to a specific interface name, > > which doesn't need to be validated in advance. > > > > Implement -o / --outbound ADDR to bind to IPv4 and IPv6 addresses, > > and --outbound-ip4 and --outbound-ip6 to bind IPv4 and IPv6 sockets > > to given interfaces. > > s/outbound-ip/outbound-if/g Oops, again. Fixed in my tree. -- Stefano