From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202502 header.b=ajVuq0cT; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id ABD7F5A026F for ; Wed, 26 Mar 2025 01:15:12 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202502; t=1742948102; bh=B4v7Nd4/jIkMTuKnNJZBmqRRhjlh9IGuEVtN7BHB9lM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ajVuq0cTLlA6BjJcKWm8hdFqF8Zpwz5ckUoqgVXl8XgxW9n4/lhJG7e34aB2iHjud iQLV2FzejqUr1EwsteyiX/eLNi87TUz1uQ/2v38WhDuH5SA7LPM8Ejt5jcSq7pV6bM urhkpYMt163zf5HUOyYFtEAqR5cpI2AojFm1GqMt1tRMz3Gj1uDFV6OfE0Bq3LQYoh Hbm5ZdhuwzkG+cwcTvlxc56i1F4FnMasz6aVP9KkxEhzQv7/4e9j6+xAF8PnVRwLKK vZxArB+LMnBEZRQo9E1x+yzfNVMh+Ht4AdBE8xI0DkOrYfwSTNhnxQTC+R/lCfLJ9f O3wcJSOOxDStA== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4ZMnNk6h6vz4xCy; Wed, 26 Mar 2025 11:15:02 +1100 (AEDT) From: David Gibson To: Stefano Brivio , Jon Maloy , passt-dev@passt.top Subject: [PATCH 2/2] udp: Improve name of UDP related ICMP sending functions Date: Wed, 26 Mar 2025 11:15:01 +1100 Message-ID: <20250326001501.1866234-3-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250326001501.1866234-1-david@gibson.dropbear.id.au> References: <20250326001501.1866234-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: MHVWG2NGRGOGFHHY4B2XR5JEWQQRO2FL X-Message-ID-Hash: MHVWG2NGRGOGFHHY4B2XR5JEWQQRO2FL X-MailFrom: dgibson@gandalf.ozlabs.org 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: David Gibson 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: udp_send_conn_fail_icmp[46]() aren't actually specific to connections failing: they can propagate a variety of ICMP errors, which might or might not break a "connection". They are, however, specific to sending ICMP errors to the tap connection, not splice or host. Rename them to better reflect that. Signed-off-by: David Gibson --- udp.c | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/udp.c b/udp.c index a706fed9..88128181 100644 --- a/udp.c +++ b/udp.c @@ -411,7 +411,7 @@ static void udp_tap_prepare(const struct mmsghdr *mmh, } /** - * udp_send_conn_fail_icmp4() - Construct and send ICMPv4 to local peer + * udp_send_tap_icmp4() - Construct and send ICMPv4 to local peer * @c: Execution context * @ee: Extended error descriptor * @toside: Destination side of flow @@ -419,11 +419,11 @@ static void udp_tap_prepare(const struct mmsghdr *mmh, * @in: First bytes (max 8) of original UDP message body * @dlen: Length of the read part of original UDP message body */ -static void udp_send_conn_fail_icmp4(const struct ctx *c, - const struct sock_extended_err *ee, - const struct flowside *toside, - struct in_addr saddr, - const void *in, size_t dlen) +static void udp_send_tap_icmp4(const struct ctx *c, + const struct sock_extended_err *ee, + const struct flowside *toside, + struct in_addr saddr, + const void *in, size_t dlen) { struct in_addr oaddr = toside->oaddr.v4mapped.a4; struct in_addr eaddr = toside->eaddr.v4mapped.a4; @@ -455,7 +455,7 @@ static void udp_send_conn_fail_icmp4(const struct ctx *c, /** - * udp_send_conn_fail_icmp6() - Construct and send ICMPv6 to local peer + * udp_send_tap_icmp6() - Construct and send ICMPv6 to local peer * @c: Execution context * @ee: Extended error descriptor * @toside: Destination side of flow @@ -464,11 +464,11 @@ static void udp_send_conn_fail_icmp4(const struct ctx *c, * @dlen: Length of the read part of original UDP message body * @flow: IPv6 flow identifier */ -static void udp_send_conn_fail_icmp6(const struct ctx *c, - const struct sock_extended_err *ee, - const struct flowside *toside, - const struct in6_addr *saddr, - void *in, size_t dlen, uint32_t flow) +static void udp_send_tap_icmp6(const struct ctx *c, + const struct sock_extended_err *ee, + const struct flowside *toside, + const struct in6_addr *saddr, + void *in, size_t dlen, uint32_t flow) { const struct in6_addr *oaddr = &toside->oaddr.a6; const struct in6_addr *eaddr = &toside->eaddr.a6; @@ -564,12 +564,11 @@ static int udp_sock_recverr(const struct ctx *c, union epoll_ref ref) * to socket? */ } else if (hdr->cmsg_level == IPPROTO_IP) { dlen = MIN(dlen, ICMP4_MAX_DLEN); - udp_send_conn_fail_icmp4(c, ee, toside, saddr.sa4.sin_addr, - data, dlen); + udp_send_tap_icmp4(c, ee, toside, saddr.sa4.sin_addr, + data, dlen); } else if (hdr->cmsg_level == IPPROTO_IPV6) { - udp_send_conn_fail_icmp6(c, ee, toside, - &saddr.sa6.sin6_addr, - data, dlen, sidx.flowi); + udp_send_tap_icmp6(c, ee, toside, &saddr.sa6.sin6_addr, + data, dlen, sidx.flowi); } } else { trace("Ignoring received IP_RECVERR cmsg on listener socket"); -- 2.49.0