On Fri, Nov 25, 2022 at 02:48:09AM +0100, Stefano Brivio wrote:Nit: On Thu, 24 Nov 2022 12:16:56 +1100 David Gibson <david(a)gibson.dropbear.id.au> wrote:Fixed. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibsonudp_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 <david(a)gibson.dropbear.id.au> --- 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 '?'