mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
af_unix: preserve const qualifier in unix_sk()
We can change unix_sk() to propagate its argument const qualifier, thanks to container_of_const(). We need to change dump_common_audit_data() 'struct unix_sock *u' local var to get a const attribute. Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Simon Horman <simon.horman@corigine.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
ae6084b739
commit
b064ba9c3c
@@ -74,10 +74,7 @@ struct unix_sock {
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
static inline struct unix_sock *unix_sk(const struct sock *sk)
|
#define unix_sk(ptr) container_of_const(ptr, struct unix_sock, sk)
|
||||||
{
|
|
||||||
return (struct unix_sock *)sk;
|
|
||||||
}
|
|
||||||
|
|
||||||
#define peer_wait peer_wq.wait
|
#define peer_wait peer_wq.wait
|
||||||
|
|
||||||
|
@@ -310,7 +310,7 @@ static void dump_common_audit_data(struct audit_buffer *ab,
|
|||||||
case LSM_AUDIT_DATA_NET:
|
case LSM_AUDIT_DATA_NET:
|
||||||
if (a->u.net->sk) {
|
if (a->u.net->sk) {
|
||||||
const struct sock *sk = a->u.net->sk;
|
const struct sock *sk = a->u.net->sk;
|
||||||
struct unix_sock *u;
|
const struct unix_sock *u;
|
||||||
struct unix_address *addr;
|
struct unix_address *addr;
|
||||||
int len = 0;
|
int len = 0;
|
||||||
char *p = NULL;
|
char *p = NULL;
|
||||||
|
Reference in New Issue
Block a user