mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-07-06 00:13:38 -04:00
sock: sockc cookie initializer
Initialize the cookie in one location to reduce code duplication and
avoid bugs from inconsistent initialization, such as that fixed in
commit 9887cba199
("ip: limit use of gso_size to udp").
Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
b515430ac9
commit
657a066702
3 changed files with 10 additions and 7 deletions
|
@ -1600,6 +1600,12 @@ struct sockcm_cookie {
|
|||
u16 tsflags;
|
||||
};
|
||||
|
||||
static inline void sockcm_init(struct sockcm_cookie *sockc,
|
||||
const struct sock *sk)
|
||||
{
|
||||
*sockc = (struct sockcm_cookie) { .tsflags = sk->sk_tsflags };
|
||||
}
|
||||
|
||||
int __sock_cmsg_send(struct sock *sk, struct msghdr *msg, struct cmsghdr *cmsg,
|
||||
struct sockcm_cookie *sockc);
|
||||
int sock_cmsg_send(struct sock *sk, struct msghdr *msg,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue