mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
net: introduce helper macro for_each_cmsghdr
Introduce helper macro for_each_cmsghdr as a wrapper of the enumerating cmsghdr from msghdr, just cleanup. Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
dd0bcc0bc8
commit
f95b414edb
10 changed files with 15 additions and 16 deletions
|
@ -103,6 +103,10 @@ struct cmsghdr {
|
|||
(cmsg)->cmsg_len <= (unsigned long) \
|
||||
((mhdr)->msg_controllen - \
|
||||
((char *)(cmsg) - (char *)(mhdr)->msg_control)))
|
||||
#define for_each_cmsghdr(cmsg, msg) \
|
||||
for (cmsg = CMSG_FIRSTHDR(msg); \
|
||||
cmsg; \
|
||||
cmsg = CMSG_NXTHDR(msg, cmsg))
|
||||
|
||||
/*
|
||||
* Get the next cmsg header
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue