public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Stefano Brivio <sbrivio@redhat.com>
Cc: Jon Maloy <jmaloy@redhat.com>, passt-dev@passt.top
Subject: Re: [PATCH 2/4] treewide: Improve robustness against sockaddrs of unexpected family
Date: Thu, 17 Apr 2025 11:14:09 +1000	[thread overview]
Message-ID: <aABV4T3XFdPM4QI2@zatzit> (raw)
In-Reply-To: <20250416114131.6592c712@elisabeth>

[-- Attachment #1: Type: text/plain, Size: 1298 bytes --]

On Wed, Apr 16, 2025 at 11:41:31AM +0200, Stefano Brivio wrote:
> On Wed, 16 Apr 2025 19:07:05 +1000
> David Gibson <david@gibson.dropbear.id.au> wrote:
> 
> > @@ -239,22 +239,28 @@ static inline void inany_from_af(union inany_addr *aa,
> >  /** inany_from_sockaddr - Extract IPv[46] address and port number from sockaddr
> >   * @aa:		Pointer to store IPv[46] address
> >   * @port:	Pointer to store port number, host order
> > - * @addr:	AF_INET or AF_INET6 socket address
> > + * @addr:	Socket address
> 
> This is actually sa_ now but... can we do something for argument names
> in general, here? What about dst, port, sa, or dst, port, addr?

Sure, done.

> 
> > + *
> > + * Return: 0 on success, -1 on error (bad address family)
> >   */
> > -static inline void inany_from_sockaddr(union inany_addr *aa, in_port_t *port,
> > -				       const union sockaddr_inany *sa)
> > +static inline int inany_from_sockaddr(union inany_addr *aa, in_port_t *port,
> > +				      const void *sa_)
> >  {
> > +	const union sockaddr_inany *sa = (const union sockaddr_inany *)sa_;
> 

-- 
David Gibson (he or they)	| 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/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2025-04-17  1:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-16  9:07 [PATCH 0/4] Translate source addresses for ICMP errors David Gibson
2025-04-16  9:07 ` [PATCH 1/4] fwd: Split out helpers for port-independent NAT David Gibson
2025-04-16  9:07 ` [PATCH 2/4] treewide: Improve robustness against sockaddrs of unexpected family David Gibson
2025-04-16  9:41   ` Stefano Brivio
2025-04-17  1:14     ` David Gibson [this message]
2025-04-16  9:07 ` [PATCH 3/4] udp: Rework offender address handling in udp_sock_recverr() David Gibson
2025-04-16 14:27   ` Stefano Brivio
2025-04-17  1:33     ` David Gibson
2025-04-16  9:07 ` [PATCH 4/4] udp: Translate offender addresses for ICMP messages David Gibson
2025-04-16 14:27 ` [PATCH 0/4] Translate source addresses for ICMP errors Stefano Brivio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aABV4T3XFdPM4QI2@zatzit \
    --to=david@gibson.dropbear.id.au \
    --cc=jmaloy@redhat.com \
    --cc=passt-dev@passt.top \
    --cc=sbrivio@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).