From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=WhiWOxfn; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTPS id D50D75A026F for ; Tue, 25 Feb 2025 15:20:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1740493204; 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=nfKwi2g481pNTwt2P+hUVJmitiJxOeROZ30s98ppEEo=; b=WhiWOxfnQnuGh9UUntaYrXDqLMecWh1iuTYUxSWvK5ZwMz3h0Fr0Jh3sB7AgAj9qacomL+ aURi44+iUNzomoxm7JGUiJidyqQzJ7gyxCqDpQ5vZSEMJKUpVuy9OuCMvYpd8KXA8n08OL THF+nol6/ByclJYIhEaQvHl1jVeRNHk= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-526-7IqiUR_GMc2MDlDWlyXU_A-1; Tue, 25 Feb 2025 09:20:03 -0500 X-MC-Unique: 7IqiUR_GMc2MDlDWlyXU_A-1 X-Mimecast-MFC-AGG-ID: 7IqiUR_GMc2MDlDWlyXU_A_1740493202 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-38f2726c0faso6037104f8f.0 for ; Tue, 25 Feb 2025 06:20:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740493202; x=1741098002; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=nfKwi2g481pNTwt2P+hUVJmitiJxOeROZ30s98ppEEo=; b=BxmTjmdINqC+EHiCrtQE9jTbm5tQqHsbTOyZraqdbw3waYmKBZy8a5vG1BecaagROw F7BEUK14129Yt4AM/EtE95tz+TmrxEDrwNVnLeagWBrmtttDJ8qBB0N5opRe0+OpmBxp 41lfm+FYCD4WKgcVU+/Yb2cef4FClZmmJN7pHWn13UnJgJcx1vwj8eIDBtcpKYP+gv+h pYpnNqN+aFTaBk8jnd4kYmwdooBcCLiHG4MKpJ+07mvUqyG0oGZO1l9lhg8vEYKR3ef/ hcNxWGtHXvOIOoLq4+wRL2PY/M/lo+0ghNa/Nq1zbV5tACL5ubMC5B+yYbKPLFfmLCnx 4XRA== X-Gm-Message-State: AOJu0Yw4cK9a56ShJ7HoLWzTVZ2XG1tIGGt6LwbDvyK4Vw7J1sr0dgch RnUnyP4q7BZnS5IGV0883n8zi2yz0eX+v8/EHr71Rp+HcBp5OgVNBpjNyXd1J7MHd0+U8ddOaEm I9B7C3kljbJO1fge8Y+IYnXArMndGp5jNHJc6dKWhD4ENEZ58G3jcvHgfI3f/fMCkkeR9UqDd8x tPxawNvd89B+Xrlk90xXPsgKOr1xmVjPNW X-Gm-Gg: ASbGncu/BOHFJDzREjXB0ajV3MQT61jLhq5tUl3ILD87zaaQsVbeD4THYXs80UxLlX2 Ftv4ELnLvzueB1333FBHV3JOD7H3wpL5RPLDvbhrAxJ4sAyU2NwI+E570iJgP4OTL6sO/lJEnVi 5OZhRCJifXBgYefGTNLUef2eBm4Si4RxakCIqWCpZFrNToxbukvqHCpWeSwcPX3RqYjxlmAb0sh 4Sla4SxgTNWez0nfgT9/OUnA82xDMVhQvvaE55mPwyHYM7l+07dm/MWLLef294IS97KRuNkrVfU NZCjs5tAsX5I5Gi8Es/+j+ttqGenK5z9Agl8mIuXmLWn X-Received: by 2002:a05:6000:1373:b0:38f:43c8:f766 with SMTP id ffacd0b85a97d-390cc60bb96mr3085568f8f.31.1740493201818; Tue, 25 Feb 2025 06:20:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IHHtlbJ+rqA8MH6ubCdNZE2UZbwuPLERWo9U4GxFVD8E901uORxPzqjL+oJFYzANeKbhVNXzw== X-Received: by 2002:a05:6000:1373:b0:38f:43c8:f766 with SMTP id ffacd0b85a97d-390cc60bb96mr3085537f8f.31.1740493201480; Tue, 25 Feb 2025 06:20:01 -0800 (PST) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [176.103.220.4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-390cd8fc1cbsm2442859f8f.92.2025.02.25.06.20.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Feb 2025 06:20:01 -0800 (PST) Date: Tue, 25 Feb 2025 15:19:58 +0100 From: Stefano Brivio To: Jon Maloy Subject: Re: [PATCH v6 4/4] udp: create and send ICMPv6 to local peer when applicable Message-ID: <20250225151958.4cb07c5e@elisabeth> In-Reply-To: <20250224192447.3758771-5-jmaloy@redhat.com> References: <20250224192447.3758771-1-jmaloy@redhat.com> <20250224192447.3758771-5-jmaloy@redhat.com> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: RS3JWVK-tlNQMSYIHAeL7GggHHEAKTbOB59O7Zeh-XU_1740493202 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: LTVHWVHTA6JHIRDOUVTQZYBKPTW6S7M4 X-Message-ID-Hash: LTVHWVHTA6JHIRDOUVTQZYBKPTW6S7M4 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, pONy4THS@protonmail.com, dgibson@redhat.com 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 Mon, 24 Feb 2025 14:24:47 -0500 Jon Maloy 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. > > We now fix this for IPv6 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. > > Note that for the sake of completeness, we even produce ICMP messages > for other error codes. We have noticed that at least ICMP_PROT_UNREACH > is propagated as an error event back to the user. Have a look at https://bugs.passt.top/show_bug.cgi?id=63#c1 if you haven't (I didn't really go through it). While bug #63 is beyond the scope of this series, if you register an account on the bug tracker you can be Cc'ed on comments. -- Stefano