public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: Stefano Brivio <sbrivio@redhat.com>
To: Jon Maloy <jmaloy@redhat.com>
Cc: passt-dev@passt.top, lvivier@redhat.com, dgibson@redhat.com
Subject: Re: [PATCH] udp: create and send ICMPv4 to local peer when applicable
Date: Mon, 10 Feb 2025 11:27:20 +0100	[thread overview]
Message-ID: <20250210112720.78896011@elisabeth> (raw)
In-Reply-To: <20250209170056.1160547-1-jmaloy@redhat.com>

On Sun,  9 Feb 2025 12:00:56 -0500
Jon Maloy <jmaloy@redhat.com> wrote:

> When a local peer sends a UDP message to a non-existing port on an
> existing remote host, that host will return an ICMP message containing
> the error code ICMP_PORT_UNREACH, plus the header and the first eight
> bytes of the original message. If the sender socket has been connected,
> it uses this message to issue a "Connection Refused" event to the user.
> 
> Until now, we have only read such events from the externally facing
> socket, but we don't forward them back to the local sender because
> we cannot read the ICMP message directly to user space. Because of
> this, the local peer will hang and wait for a response that never
> arrives.

I haven't had a chance to really review this yet, in general it looks
great to me (I was afraid it would be more complicated).

I have a couple of preliminary questions though:

- referring to the paragraph above: what about TCP (which is the case
  where a peer might actually hang)? Do you plan to support errors for
  TCP's connect() in a separate patch?

> We now fix this for IPv4 by recreating and forwarding a correct ICMP
> message back to the internal sender. We synthesize the message based
> on the information in the extended error structure, plus the returned
> part of the original message body.

- ...and what about IPv6 and NDP? Also separate patch?

In that case, would it perhaps make sense to implement and submit that
as a series so that we have a consistent behaviour to begin with?

-- 
Stefano


  reply	other threads:[~2025-02-10 10:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-09 17:00 [PATCH] udp: create and send ICMPv4 to local peer when applicable Jon Maloy
2025-02-10 10:27 ` Stefano Brivio [this message]
2025-02-11  0:55 ` David Gibson
2025-02-12 21:39   ` Jon Maloy
2025-02-12 23:21     ` David Gibson
2025-02-13 19:07     ` Jon Maloy
2025-02-13 19:17       ` Stefano Brivio
2025-02-13 19:28         ` Jon Maloy

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=20250210112720.78896011@elisabeth \
    --to=sbrivio@redhat.com \
    --cc=dgibson@redhat.com \
    --cc=jmaloy@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=passt-dev@passt.top \
    /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).