netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Tom Parkin <tparkin@katalix.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH net-next] l2tp: fix ICMP error handling for UDP-encap sockets
Date: Fri, 3 May 2024 15:32:14 -0700	[thread overview]
Message-ID: <20240503153214.3432d313@kernel.org> (raw)
In-Reply-To: <20240430140343.389543-1-tparkin@katalix.com>

On Tue, 30 Apr 2024 15:03:43 +0100 Tom Parkin wrote:
> Subject: [PATCH net-next] l2tp: fix ICMP error handling for UDP-encap sockets

Seems like we should target it at net? Description indicates it's 
a clear regression.

> +static void l2tp_udp_encap_err_recv(struct sock *sk, struct sk_buff *skb, int err,
> +				    __be16 port, u32 info, u8 *payload)
> +{
> +	struct l2tp_tunnel *tunnel = l2tp_sk_to_tunnel(sk);
> +
> +	if (!tunnel || tunnel->fd < 0)
> +		return;

not: the !tunnel can't happen, right?

> +	sk->sk_err = err;
> +	sk_error_report(sk);
> +
> +	if (ip_hdr(skb)->version == IPVERSION) {
> +		if (inet_test_bit(RECVERR, sk))
> +			return ip_icmp_error(sk, skb, err, port, info, payload);
> +	}
> +#if IS_ENABLED(CONFIG_IPV6)
> +	else
> +		if (inet6_test_bit(RECVERR6, sk))
> +			return ipv6_icmp_error(sk, skb, err, port, info, payload);
> +#endif

nit: mismatch on the braces here, this would be more usual:

+	if (ip_hdr(skb)->version == IPVERSION) {
+		if (inet_test_bit(RECVERR, sk))
+			return ip_icmp_error(sk, skb, err, port, info, payload);
+#if IS_ENABLED(CONFIG_IPV6)
+	} else {
+		if (inet6_test_bit(RECVERR6, sk))
+			return ipv6_icmp_error(sk, skb, err, port, info, payload);
+#endif
+	}

+}

  parent reply	other threads:[~2024-05-03 22:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-30 14:03 [PATCH net-next] l2tp: fix ICMP error handling for UDP-encap sockets Tom Parkin
2024-04-30 16:37 ` James Chapman
2024-05-03 22:32 ` Jakub Kicinski [this message]
2024-05-07 14:10   ` Tom Parkin

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=20240503153214.3432d313@kernel.org \
    --to=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tparkin@katalix.com \
    /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.
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 NNTP newsgroup(s).