summaryrefslogtreecommitdiff
path: root/net/can
diff options
context:
space:
mode:
authorWillem de Bruijn <willemb@google.com>2025-02-14 17:26:59 -0500
committerJakub Kicinski <kuba@kernel.org>2025-02-18 18:27:19 -0800
commit6ad861519a69ecf3cf032c579e18569f62b81263 (patch)
treedced43bf294a41a8ebf5d5f5c137e06f47ac0108 /net/can
parentaaf6532d119d8ad4c75420b021d2649864133583 (diff)
net: initialize mark in sockcm_init
Avoid open coding initialization of sockcm fields. Avoid reading the sk_priority field twice. This ensures all callers, existing and future, will correctly try a cmsg passed mark before sk_mark. This patch extends support for cmsg mark to: packet_spkt and packet_tpacket and net/can/raw.c. This patch extends support for cmsg priority to: packet_spkt and packet_tpacket. Signed-off-by: Willem de Bruijn <willemb@google.com> Reviewed-by: David Ahern <dsahern@kernel.org> Link: https://patch.msgid.link/20250214222720.3205500-3-willemdebruijn.kernel@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/can')
-rw-r--r--net/can/raw.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/can/raw.c b/net/can/raw.c
index 46e8ed9d64da..9b1d5f036f57 100644
--- a/net/can/raw.c
+++ b/net/can/raw.c
@@ -963,7 +963,7 @@ static int raw_sendmsg(struct socket *sock, struct msghdr *msg, size_t size)
skb->dev = dev;
skb->priority = sockc.priority;
- skb->mark = READ_ONCE(sk->sk_mark);
+ skb->mark = sockc.mark;
skb->tstamp = sockc.transmit_time;
skb_setup_tx_timestamp(skb, &sockc);