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=YORyrrnV; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTPS id E25B55A0272 for ; Mon, 10 Feb 2025 11:27:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1739183248; 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=N7peQ4jHa1IM3LP8MaGRSrbOHcGlE1Q5ftQQzB3QuhE=; b=YORyrrnVu56B4wngUU64IOprFLA+1HxVWPME8LSyHYRQSMpnCaud2PJBnnGiD9V7nNEpz+ 5xrPdYEfhc+IHs5YSA/phLKNq2gewamG5+TqKfmMmeMJh3zhAMacUavjS3lQNBPj0dZ3mp /oXKwcJamYHDqWMgxkRz3mPPjqeV0Qo= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-511-lCE_FYqDM6yXyzZj-p43mw-1; Mon, 10 Feb 2025 05:27:27 -0500 X-MC-Unique: lCE_FYqDM6yXyzZj-p43mw-1 X-Mimecast-MFC-AGG-ID: lCE_FYqDM6yXyzZj-p43mw Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-43626224274so24817035e9.0 for ; Mon, 10 Feb 2025 02:27:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739183245; x=1739788045; 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=N7peQ4jHa1IM3LP8MaGRSrbOHcGlE1Q5ftQQzB3QuhE=; b=IqanK4JVbsYH6223pjwpSqCotcGNAGH8/R9x7H/MiYpOWLXFnxrM92qp7RcxCp0bjP gZw5Y4LjBNVorad8wXPcpZBWO74PSHBBrUw85Z/hdbDuiaDzTSuQewSkWJVxVwm8OLRk 7i9p0gKbG8XVrfno/OzqKkmWCK1B1EDmg2VN8clO8ssAUdzyFIpimNLTBUZ+9ncwcMcd F7To7D9iH/a3K1CG8WQ9349tXtDl10Vp/Kumxz/okCraLlZ4bmcQcxx59Pavi0PuWmn4 /0XzGY5Dn5fyWe0LH30DsUlJAV4Zno3z7RbQuoybpsE0hHEmZ9N7rmal/4saqsvDH8mD f1SQ== X-Gm-Message-State: AOJu0YxX5SQp/3Ts6I7kBs2kY1wvthfRwnFOkXhQzcmd/4t1KVn0b/AJ LbKhQ1U1dEObr+juDhcFM2+b0Sz8d4Xy1tzEVMVTz0rlgrXvT1OFKzZIyDeVE6nu+wlGbumYUPF FdQuokPr8gvUCnnrAKm3j6yOHQVFWy6gseg9/Xy5nGzB/+zmW2hFKeCeQNTuBzBLU07VbECrdod +MOqUWv75AcEv8emNQiKGzwbeuZ6thFgAU X-Gm-Gg: ASbGncvlkKf7n7oHfh9DKrmXEqgiJ5tnkZMNTfpcnfavLy+KtycOZuLOzxShIp6F1E+ 1YgWq5YDNDOIVN9ql6HnKmZA3Z0C+ManZ1MhDGTIzs4uP4RTT6+YDtiu4HT89pH0ujIQK5vwBVD eNJAgIqL1U1VER6A75L5BoRT4g5RO27GFYh+7vgoqRKzDm2jEixPJGGKrZVEln7a38SK04dDpLV RiYvdEW2OS1n0IdWWp8Y2/flz3mRp/9eNT1ADRpazTuZkCTJDL3pg8hz6kvvQ2hAAhGXdTwW1f+ bhZ/ROHmZbqhgAl+ X-Received: by 2002:a05:600c:1e08:b0:439:448c:6135 with SMTP id 5b1f17b1804b1-439448c6335mr24369395e9.24.1739183244756; Mon, 10 Feb 2025 02:27:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IFGjxZkMuIpT70iWYGJwKiJBesLVi6a0D2nhZM4go66aqLoAvNXuTjiQKdq8/qiOvyN12f7Bw== X-Received: by 2002:a05:600c:1e08:b0:439:448c:6135 with SMTP id 5b1f17b1804b1-439448c6335mr24368295e9.24.1739183242786; Mon, 10 Feb 2025 02:27:22 -0800 (PST) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [2a10:fc81:a806:d6a9::1]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38dcd21fe18sm8764870f8f.91.2025.02.10.02.27.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Feb 2025 02:27:21 -0800 (PST) Date: Mon, 10 Feb 2025 11:27:20 +0100 From: Stefano Brivio To: Jon Maloy Subject: Re: [PATCH] udp: create and send ICMPv4 to local peer when applicable Message-ID: <20250210112720.78896011@elisabeth> In-Reply-To: <20250209170056.1160547-1-jmaloy@redhat.com> References: <20250209170056.1160547-1-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: 4zAlzW7QD5YdW4YDLgKVS7WCQnT3R_np_WAW6_ow4GM_1739183247 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: DL35NXZGZUPJTKEASMNMFE6WZEIKZRIT X-Message-ID-Hash: DL35NXZGZUPJTKEASMNMFE6WZEIKZRIT 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, lvivier@redhat.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 Sun, 9 Feb 2025 12:00:56 -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. 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