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.129.124]) by passt.top (Postfix) with ESMTP id 0BAB35A0262 for ; Tue, 21 Mar 2023 09:18:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1679386735; 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=RxJXTi5PxqZfWlrIQ27U6lcbbEwU+x++82ZbHMFzMdA=; b=ipXccbvVcnhhkOOfqj/J4a7WtGI+kDQcvhNQ15WKTOau1CeVimxLa0dOI+cvb8eLQhpVNC D9YN74HOO3kMeung/r+AJ2u94X1WtEFSTJIVQ7RptjaV/fH/I1fist6h0tWzLWhuQ9xvQC UF+OYOfmdMdHf1/waNjZa7RdQPfWeSs= 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-497-d5_KS-oKNx23mzLzI2_1DA-1; Tue, 21 Mar 2023 04:18:51 -0400 X-MC-Unique: d5_KS-oKNx23mzLzI2_1DA-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 097193C10C62; Tue, 21 Mar 2023 08:18:51 +0000 (UTC) Received: from maya.cloud.tilaa.com (unknown [10.33.32.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8AAC040C6E67; Tue, 21 Mar 2023 08:18:50 +0000 (UTC) Date: Tue, 21 Mar 2023 09:18:48 +0100 From: Stefano Brivio To: Paul Holzinger Subject: Re: [PATCH] pasta: fix tcp port forwarding in auto mode Message-ID: <20230321091848.4a982a40@elisabeth> In-Reply-To: <20230320181034.87131-1-pholzing@redhat.com> References: <20230320181034.87131-1-pholzing@redhat.com> 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: FWLAGF5QYW4VUZT3FXDCO7OO3U6DVRZE X-Message-ID-Hash: FWLAGF5QYW4VUZT3FXDCO7OO3U6DVRZE 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, David Gibson 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: Thanks for the patch! On Mon, 20 Mar 2023 19:10:34 +0100 Paul Holzinger wrote: > The logic in tcp_timer() was inverted. fwd_out should expose the host > ports in the ns. Therfore it must read the ports on the host and then > bind them in the netns. The same for fwd_in which checks ports in the > ns and then exposes them on the host. > > Note that this only fixes tcp ports, udp does not seems to work at all > right now with the auto mode. Note that for UDP there's no periodic scan, "auto" just checks bound ports when pasta starts: -u, --udp-ports spec Configure UDP port forwarding to namespace. spec is as described for TCP above, and the list of ports is derived from listening sockets reported by /proc/net/udp and /proc/net/udp6, see proc(5), when pasta starts (not periodically). > Signed-off-by: Paul Holzinger Fixes: 1128fa03fe73 ("Improve types and names for port forwarding configuration") (I'll add that tag). The patch itself looks good to me. I'm now looking at other parts (tcp_sock_init()) where we seem to have the same kind of swap. Unfortunately this is only covered by the Podman demo as a test, which has been disabled for a while now: https://bugs.passt.top/show_bug.cgi?id=29 and as David is meanwhile working to improve the test framework, we can probably wait a bit to introduce a new test. Meanwhile I'll check this part manually on related changes. -- Stefano