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=QC/lPoIL; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 5921C5A0271 for ; Fri, 28 Mar 2025 04:34:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202502; t=1743132859; bh=VfeAmgzQlCUwnQr+uHD7rZRB5Rw6NitiX2gmTbmC2ss=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QC/lPoILmnBsLFHmssmWn3omOkO93UPHKxLnMROZYQQlcjrSFpXVu5zEXQ5BMOniU 0uSr3HfqJ8IeB9YClJ6tfEU0cmf8o9L7ZBmvh2ZBbu9t4xyOLk7VBx6c3HThS2z92m VZExwQNFprl+hKthb6EuUz6CKvU4yrjoBtGkgrBSR7brkI8818pDVQYF4kp9U3egDu fRfy+hz2HfHkNwUrMpYP1Xrzv3oovdQa8qIn7Rdew5olK9T7/vchwlGxrcRvknfT2Q zO98TbTKzir1zc+IPuRztuwIXJ2/vhlCHKSdutAg1Q0qwlJJtRryU8HE4j3ISuzyuU eIsmVqZtPdwDg== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4ZP5jl5MC7z4x6n; Fri, 28 Mar 2025 14:34:19 +1100 (AEDT) From: David Gibson To: Stefano Brivio , passt-dev@passt.top, Jon Maloy Subject: [PATCH v2 2/2] udp: Improve name of UDP related ICMP sending functions Date: Fri, 28 Mar 2025 14:34:15 +1100 Message-ID: <20250328033415.1038536-3-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250328033415.1038536-1-david@gibson.dropbear.id.au> References: <20250328033415.1038536-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: ACDD6TVK4GSBPJJJQIPFW5M6CKPHZT4B X-Message-ID-Hash: ACDD6TVK4GSBPJJJQIPFW5M6CKPHZT4B 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 Acked-by: Jon Maloy --- udp.c | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/udp.c b/udp.c index e410f55e..39431d72 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; @@ -565,13 +565,12 @@ 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, &eh->ee, toside, - eh->saddr.sa4.sin_addr, - data, dlen); + udp_send_tap_icmp4(c, &eh->ee, toside, + eh->saddr.sa4.sin_addr, data, dlen); } else if (hdr->cmsg_level == IPPROTO_IPV6) { - udp_send_conn_fail_icmp6(c, &eh->ee, toside, - &eh->saddr.sa6.sin6_addr, - data, dlen, sidx.flowi); + udp_send_tap_icmp6(c, &eh->ee, toside, + &eh->saddr.sa6.sin6_addr, data, + dlen, sidx.flowi); } } else { trace("Ignoring received IP_RECVERR cmsg on listener socket"); -- 2.49.0