.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | #include <linux/module.h> |
---|
2 | 3 | #include <linux/sock_diag.h> |
---|
3 | 4 | #include <linux/net.h> |
---|
.. | .. |
---|
22 | 23 | pinfo.pdi_flags = 0; |
---|
23 | 24 | if (po->running) |
---|
24 | 25 | pinfo.pdi_flags |= PDI_RUNNING; |
---|
25 | | - if (po->auxdata) |
---|
| 26 | + if (packet_sock_flag(po, PACKET_SOCK_AUXDATA)) |
---|
26 | 27 | pinfo.pdi_flags |= PDI_AUXDATA; |
---|
27 | | - if (po->origdev) |
---|
| 28 | + if (packet_sock_flag(po, PACKET_SOCK_ORIGDEV)) |
---|
28 | 29 | pinfo.pdi_flags |= PDI_ORIGDEV; |
---|
29 | 30 | if (po->has_vnet_hdr) |
---|
30 | 31 | pinfo.pdi_flags |= PDI_VNETHDR; |
---|
.. | .. |
---|
39 | 40 | struct nlattr *mca; |
---|
40 | 41 | struct packet_mclist *ml; |
---|
41 | 42 | |
---|
42 | | - mca = nla_nest_start(nlskb, PACKET_DIAG_MCLIST); |
---|
| 43 | + mca = nla_nest_start_noflag(nlskb, PACKET_DIAG_MCLIST); |
---|
43 | 44 | if (!mca) |
---|
44 | 45 | return -EMSGSIZE; |
---|
45 | 46 | |
---|
.. | .. |
---|
142 | 143 | rp = nlmsg_data(nlh); |
---|
143 | 144 | rp->pdiag_family = AF_PACKET; |
---|
144 | 145 | rp->pdiag_type = sk->sk_type; |
---|
145 | | - rp->pdiag_num = ntohs(po->num); |
---|
| 146 | + rp->pdiag_num = ntohs(READ_ONCE(po->num)); |
---|
146 | 147 | rp->pdiag_ino = sk_ino; |
---|
147 | 148 | sock_diag_save_cookie(sk, rp->pdiag_cookie); |
---|
148 | 149 | |
---|