Skip to content

Commit

Permalink
ipv4: initialize inet socket cookies with sockcm_init
Browse files Browse the repository at this point in the history
Avoid open coding the same logic.

Signed-off-by: Willem de Bruijn <willemb@google.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://patch.msgid.link/20250214222720.3205500-4-willemdebruijn.kernel@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Willem de Bruijn authored and Jakub Kicinski committed Feb 19, 2025
1 parent 6ad8615 commit 9478879
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions include/net/ip.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,8 @@ static inline void ipcm_init_sk(struct ipcm_cookie *ipcm,
{
ipcm_init(ipcm);

ipcm->sockc.mark = READ_ONCE(inet->sk.sk_mark);
ipcm->sockc.priority = READ_ONCE(inet->sk.sk_priority);
ipcm->sockc.tsflags = READ_ONCE(inet->sk.sk_tsflags);
sockcm_init(&ipcm->sockc, &inet->sk);

ipcm->oif = READ_ONCE(inet->sk.sk_bound_dev_if);
ipcm->addr = inet->inet_saddr;
ipcm->protocol = inet->inet_num;
Expand Down

0 comments on commit 9478879

Please sign in to comment.