af_packet: preserve const qualifier in pkt_sk()
authorEric Dumazet <edumazet@google.com>
Fri, 17 Mar 2023 15:55:31 +0000 (15:55 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 18 Mar 2023 12:23:33 +0000 (12:23 +0000)
commit68ac9a8b6e65c7cbbe96541353dab1b3f8de2043
tree3c16170c8c27636a63b6f338c4e6be616d65eda7
parent94c540fbfc80ef95ec398fc77da1920de2946edb
af_packet: preserve const qualifier in pkt_sk()

We can change pkt_sk() to propagate const qualifier of its argument,
thanks to container_of_const()

This should avoid some potential errors caused by accidental
(const -> not_const) promotion.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Willem de Bruijn <willemb@google.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/packet/internal.h