ipv6: replace ipcm6_init calls with ipcm6_init_sk

commit 096208592b09c2f5fc0c1a174694efa41c04209d upstream.

This initializes tclass and dontfrag before cmsg parsing, removing the
need for explicit checks against -1 in each caller.

Leave hlimit set to -1, because its full initialization
(in ip6_sk_dst_hoplimit) requires more state (dst, flowi6, ..).

This also prepares for calling sockcm_init in a follow-on patch.

Signed-off-by: Willem de Bruijn <willemb@google.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://patch.msgid.link/20250214222720.3205500-7-willemdebruijn.kernel@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Willem de Bruijn
2025-02-14 17:27:03 -05:00
committed by Greg Kroah-Hartman
parent 348e541fef
commit 3c44ebad5a
4 changed files with 3 additions and 29 deletions
-9
View File
@@ -363,15 +363,6 @@ struct ipcm6_cookie {
struct ipv6_txoptions *opt;
};
static inline void ipcm6_init(struct ipcm6_cookie *ipc6)
{
*ipc6 = (struct ipcm6_cookie) {
.hlimit = -1,
.tclass = -1,
.dontfrag = -1,
};
}
static inline void ipcm6_init_sk(struct ipcm6_cookie *ipc6,
const struct sock *sk)
{