diff options
| author | Gu Zheng <guz.fnst@cn.fujitsu.com> | 2014-12-10 22:22:04 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2014-12-10 22:41:55 -0500 |
| commit | f95b414edb18de59940dcebbefb49cf25c6d505c (patch) | |
| tree | 654de508641fd2c82428f43387b72fd1a3dcef42 /include/linux | |
| parent | dd0bcc0bc842e0d2c981102376d867c1a8bad320 (diff) | |
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>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/socket.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/socket.h b/include/linux/socket.h index 048d6d6eed6d..6e49a14365dc 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h | |||
| @@ -103,6 +103,10 @@ struct cmsghdr { | |||
| 103 | (cmsg)->cmsg_len <= (unsigned long) \ | 103 | (cmsg)->cmsg_len <= (unsigned long) \ |
| 104 | ((mhdr)->msg_controllen - \ | 104 | ((mhdr)->msg_controllen - \ |
| 105 | ((char *)(cmsg) - (char *)(mhdr)->msg_control))) | 105 | ((char *)(cmsg) - (char *)(mhdr)->msg_control))) |
| 106 | #define for_each_cmsghdr(cmsg, msg) \ | ||
| 107 | for (cmsg = CMSG_FIRSTHDR(msg); \ | ||
| 108 | cmsg; \ | ||
| 109 | cmsg = CMSG_NXTHDR(msg, cmsg)) | ||
| 106 | 110 | ||
| 107 | /* | 111 | /* |
| 108 | * Get the next cmsg header | 112 | * Get the next cmsg header |
