diff mbox series

[net-next,1/3] ipv6: remove leftover ip6 cookie initializer

Message ID 20250307033620.411611-2-willemdebruijn.kernel@gmail.com (mailing list archive)
State Accepted
Commit 54580ccdd8a9c6821fd6f72171d435480867e4c3
Delegated to: Netdev Maintainers
Headers show
Series follow-up on deduplicate cookie logic | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 7 of 7 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 3 this patch: 3
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2025-03-07--06-00 (tests: 894)

Commit Message

Willem de Bruijn March 7, 2025, 3:34 a.m. UTC
From: Willem de Bruijn <willemb@google.com>

As of the blamed commit ipc6.dontfrag is always initialized at the
start of udpv6_sendmsg, by ipcm6_init_sk, to either 0 or 1.

Later checks against -1 are no longer needed and the branches are now
dead code.

The blamed commit had removed those branches. But I had overlooked
this one case.

UDP has both a lockless fast path and a slower path for corked
requests. This branch remained in the fast path.

Fixes: 096208592b09 ("ipv6: replace ipcm6_init calls with ipcm6_init_sk")
Signed-off-by: Willem de Bruijn <willemb@google.com>
---
 net/ipv6/ip6_output.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Eric Dumazet March 7, 2025, 10:05 a.m. UTC | #1
On Fri, Mar 7, 2025 at 4:36 AM Willem de Bruijn
<willemdebruijn.kernel@gmail.com> wrote:
>
> From: Willem de Bruijn <willemb@google.com>
>
> As of the blamed commit ipc6.dontfrag is always initialized at the
> start of udpv6_sendmsg, by ipcm6_init_sk, to either 0 or 1.
>
> Later checks against -1 are no longer needed and the branches are now
> dead code.
>
> The blamed commit had removed those branches. But I had overlooked
> this one case.
>
> UDP has both a lockless fast path and a slower path for corked
> requests. This branch remained in the fast path.
>
> Fixes: 096208592b09 ("ipv6: replace ipcm6_init calls with ipcm6_init_sk")
> Signed-off-by: Willem de Bruijn <willemb@google.com>

Reviewed-by: Eric Dumazet <edumazet@google.com>
diff mbox series

Patch

diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index d577bf2f3053..d91da522c34e 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -2054,8 +2054,6 @@  struct sk_buff *ip6_make_skb(struct sock *sk,
 		ip6_cork_release(cork, &v6_cork);
 		return ERR_PTR(err);
 	}
-	if (ipc6->dontfrag < 0)
-		ipc6->dontfrag = inet6_test_bit(DONTFRAG, sk);
 
 	err = __ip6_append_data(sk, &queue, cork, &v6_cork,
 				&current->task_frag, getfrag, from,