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 2C94B5A026D for ; Tue, 7 Nov 2023 13:45:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1699361100; 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=YV8dcfnPhffAAv6QhC9DSYHEu65odjE9hbjOhC1mNKw=; b=c0ZZ1bITBF4GwQpwW0mFoQyZrj2qvyjA+wsHCDk7bZfF8PjqQkH3I3bNunRNbB1RP9NhME nE7Y/njzujHJWAlomoLm7JohqkllPYEb2yAGIOVMFsE+fhrJjiDrSqpOo4sNWGAjRTb571 Oju0R2q+OycDvmmx1U7M8C691ALg+0A= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-385-eT_OrdfqPeulbk7oXOMXqA-1; Tue, 07 Nov 2023 07:44:56 -0500 X-MC-Unique: eT_OrdfqPeulbk7oXOMXqA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 099343C0F426; Tue, 7 Nov 2023 12:44:56 +0000 (UTC) Received: from elisabeth (unknown [10.39.208.12]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3BADE40C6EB9; Tue, 7 Nov 2023 12:44:54 +0000 (UTC) Date: Tue, 7 Nov 2023 13:44:40 +0100 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH v2 0/9] Clean ups to automatic port forwarding Message-ID: <20231107134440.0d0517ec@elisabeth> In-Reply-To: <20231103022303.968638-1-david@gibson.dropbear.id.au> References: <20231103022303.968638-1-david@gibson.dropbear.id.au> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.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: AXELAH4IBKDGWC7DPUK2U7RWDCD7LE65 X-Message-ID-Hash: AXELAH4IBKDGWC7DPUK2U7RWDCD7LE65 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 Fri, 3 Nov 2023 13:22:54 +1100 David Gibson wrote: > This contains an assortment of cleanups to the code supporting the > automatic port forwarding more for past - specifically > get_bound_ports() and related functions. This shouldn't mae any > functional changes. > > Based on the series with fixes for new cppcheck-2.12 warnings. > > Changes since v1: > * Some comment tweaks based on Stefano's feedback. > > David Gibson (9): > conf: Cleaner initialisation of default forwarding modes > port_fwd: Move automatic port forwarding code to port_fwd.[ch] > port_fwd: Better parameterise procfs_scan_listen() > util: Add open_in_ns() helper > port_fwd: Pre-open /proc/net/* files rather than on-demand > port_fwd: Don't NS_CALL get_bound_ports() > port_fwd: Split TCP and UDP cases for get_bound_ports() > port_fwd: Move port scanning /proc fds into struct port_fwd > port_fwd: Simplify get_bound_ports_*() to port_fwd_scan_*() Applied. -- Stefano