From: Jakub Kicinski <kuba@kernel.org>
To: gfree.wind@outlook.com
Cc: edumazet@google.com, davem@davemloft.net,
yoshfuji@linux-ipv6.org, dsahern@kernel.org, pabeni@redhat.com,
netdev@vger.kernel.org, Gao Feng <gfree.wind@gmail.com>
Subject: Re: [PATCH net-next 1/1] tcp: Remove useless acceptable check because the return vlaue always is 0
Date: Thu, 28 Jul 2022 19:50:03 -0700 [thread overview]
Message-ID: <20220728195003.5dd7cf34@kernel.org> (raw)
In-Reply-To: <OSZP286MB1404946FF81173281D3BF67695949@OSZP286MB1404.JPNP286.PROD.OUTLOOK.COM>
On Wed, 27 Jul 2022 06:58:03 +0800 gfree.wind@outlook.com wrote:
> From: Gao Feng <gfree.wind@gmail.com>
>
> The conn_request function of IPv4 and IPv6 always returns 0, so it's
> useless to check for acceptable.
I don't think this is an improvement. If the function returns
a value we should not be ignoring it.
> diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
> index 3ec4edc37313..82a875efd1e8 100644
> --- a/net/ipv4/tcp_input.c
> +++ b/net/ipv4/tcp_input.c
> @@ -6453,12 +6453,11 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb)
> */
> rcu_read_lock();
> local_bh_disable();
> - acceptable = icsk->icsk_af_ops->conn_request(sk, skb) >= 0;
> + /* TCP's conn_request always returns 0. */
> + icsk->icsk_af_ops->conn_request(sk, skb);
> local_bh_enable();
> rcu_read_unlock();
>
> - if (!acceptable)
> - return 1;
> consume_skb(skb);
> return 0;
> }
prev parent reply other threads:[~2022-07-29 2:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-26 22:58 [PATCH net-next 1/1] tcp: Remove useless acceptable check because the return vlaue always is 0 gfree.wind
2022-07-29 2:50 ` Jakub Kicinski [this message]
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=20220728195003.5dd7cf34@kernel.org \
--to=kuba@kernel.org \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=gfree.wind@gmail.com \
--cc=gfree.wind@outlook.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=yoshfuji@linux-ipv6.org \
/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).