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 CDBB05A0262 for ; Tue, 21 Mar 2023 14:55:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1679406921; 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=LKQ9vgfbnqlVv0K7drtiv95H+5/Zg1ZJ/u3dhksU8GY=; b=RPI8VdmRXwtWpwNrkG96cytc9eCTdtmpjvqXOqT7FN3AfBrTTP7CyIr0qmf9Gx2jQktEjk uXxJ4bwhc89vp0ISe04C2tBheK8mnAQDf4IJGS+3vLo4UtEgdPpo05H5n3zovtH2h2xClI 4tP0BUcL5vZx9O52cjhau4zOc7NPcD8= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-379-p0yhUgm0OOaIVaLdKpQeRA-1; Tue, 21 Mar 2023 09:55:20 -0400 X-MC-Unique: p0yhUgm0OOaIVaLdKpQeRA-1 Received: by mail-wm1-f71.google.com with SMTP id j27-20020a05600c1c1b00b003edd2023418so4128325wms.4 for ; Tue, 21 Mar 2023 06:55:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679406919; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=LKQ9vgfbnqlVv0K7drtiv95H+5/Zg1ZJ/u3dhksU8GY=; b=kt4iu+TuDenZIxgNU1ytxrhQp6vEGJnojJ75TMeR8Hhjq2Me11GVhhJKkY3JlQME/d 1sCpqujRUWcYX1sAjmISXYkvGiIamIqsLQ2252C//Yt1ZlDDZnxY0WZDOfNvjRk8mvf9 gFvm4plYnTJy1ZvicDiiNodYPRKdFnj+WKydFJn7Rz9tTo+29sVo6cKl0LRZNMyaAtnM XODxmS3n6GY2ZBF1J1EMf39KhF2A6z7+DUw/Syi0vLRaIw6IUROuvqzUvJ551A28CKZx 5Ue6vnnPN0xoLfyteKaU19neRsWDOVfuvRUwJ0u3vrVXOc6RchsZSLCLP48kbB7hVWg6 nmWA== X-Gm-Message-State: AO0yUKV+tru8QLcQAAKswhwXMSeKlHEn7d4nX1m1GNy2KRGGyRe/L3eR tPE2AlQ0SgcYj6lMqmWPql34nN9uK0rSCc0XnjXytecMLNwcWQIagzUvH8RMJca4THkdHoejz64 CjzoRcWnXDlTS X-Received: by 2002:adf:f3d1:0:b0:2ce:ae49:5edb with SMTP id g17-20020adff3d1000000b002ceae495edbmr2284216wrp.7.1679406919358; Tue, 21 Mar 2023 06:55:19 -0700 (PDT) X-Google-Smtp-Source: AK7set+lnetyNJ6exPqb3pdfTerEDyKKCBhjStNFmt6P2MAEm++5uJd36Q+UU+1nyoKvGI02otVa3g== X-Received: by 2002:adf:f3d1:0:b0:2ce:ae49:5edb with SMTP id g17-20020adff3d1000000b002ceae495edbmr2284205wrp.7.1679406919102; Tue, 21 Mar 2023 06:55:19 -0700 (PDT) Received: from [192.168.188.25] ([80.243.52.134]) by smtp.gmail.com with ESMTPSA id i7-20020adffc07000000b002c5706f7c6dsm11386546wrr.94.2023.03.21.06.55.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 21 Mar 2023 06:55:18 -0700 (PDT) Message-ID: <462fd5de-1d51-2a1d-a5f7-aeb755dadb2e@redhat.com> Date: Tue, 21 Mar 2023 14:55:17 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH] pasta: fix tcp port forwarding in auto mode To: Stefano Brivio References: <20230320181034.87131-1-pholzing@redhat.com> <20230321091848.4a982a40@elisabeth> From: Paul Holzinger In-Reply-To: <20230321091848.4a982a40@elisabeth> X-Mimecast-Spam-Score: 0 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: K5A5TYOUM4PTQBDHWWNZVV4Q4F22PU74 X-Message-ID-Hash: K5A5TYOUM4PTQBDHWWNZVV4Q4F22PU74 X-MailFrom: pholzing@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: On 21/03/2023 09:18, Stefano Brivio wrote: > 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). Ok this makes sense then, is there a bug to track this? Because without it auto mode for UDP is useless for my Podman use case. >> 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. >