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 2CF295A0082 for ; Fri, 25 Nov 2022 02:48:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669340893; 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=qY2C5z4ZWBn+Zn/3zEYU07TR4FsXZauUyff+QZrjZkI=; b=eaPS96o4ubTXWUJgl52FOX5QZlz7wmjj+jgPOsejEfOcswsrBOdX0HOEgLTe3Kx+K6N/Ly vIJeeGDQGOznlJHLFWxk0Oaivpyue/JHsKERzbPdfzaOCYaIVavMdbe2q/YOoXHuizGWLF aU13BDFqunYEvqwJmbL+pFLq2K3dNmM= 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-470-Gx0CgdurNqaoP8eeS0V5SA-1; Thu, 24 Nov 2022 20:48:12 -0500 X-MC-Unique: Gx0CgdurNqaoP8eeS0V5SA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1A9E3380450F; Fri, 25 Nov 2022 01:48:12 +0000 (UTC) Received: from maya.cloud.tilaa.com (ovpn-208-30.brq.redhat.com [10.40.208.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D499E111E3EB; Fri, 25 Nov 2022 01:48:11 +0000 (UTC) Date: Fri, 25 Nov 2022 02:48:09 +0100 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH v2 13/16] udp: Add helper to extract port from a sockaddr_in or sockaddr_in6 Message-ID: <20221125024809.14ad1a30@elisabeth> In-Reply-To: <20221124011659.1024901-14-david@gibson.dropbear.id.au> References: <20221124011659.1024901-1-david@gibson.dropbear.id.au> <20221124011659.1024901-14-david@gibson.dropbear.id.au> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: AOXDOSOGDPZJGDBWAY64ZJQHSHYXT5NO X-Message-ID-Hash: AOXDOSOGDPZJGDBWAY64ZJQHSHYXT5NO 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.3 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: Nit: On Thu, 24 Nov 2022 12:16:56 +1100 David Gibson wrote: > udp_sock_handler_splice() has a somewhat clunky if to extract the port from > a socket address which could be either IPv4 or IPv6. Future changes are > going to make this even more clunky, so introduce a helper function to > do this extraction. > > Signed-off-by: David Gibson > --- > udp.c | 26 ++++++++++++++------------ > 1 file changed, 14 insertions(+), 12 deletions(-) > > diff --git a/udp.c b/udp.c > index 1db55e5..a79e5ca 100644 > --- a/udp.c > +++ b/udp.c > @@ -498,6 +498,19 @@ static int udp_splice_new_ns(void *arg) > return 0; > } > > +/** > + * sa_port() - Determine port from a sockaddr_in or sockaddr_in6 > + * @v6: Is @sa a sockaddr_in6 (otherwise sockaddr_in) Missing '?' -- Stefano