aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp
diff options
context:
space:
mode:
authorGu Zheng <guz.fnst@cn.fujitsu.com>2014-12-10 22:22:04 -0500
committerDavid S. Miller <davem@davemloft.net>2014-12-10 22:41:55 -0500
commitf95b414edb18de59940dcebbefb49cf25c6d505c (patch)
tree654de508641fd2c82428f43387b72fd1a3dcef42 /net/sctp
parentdd0bcc0bc842e0d2c981102376d867c1a8bad320 (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 'net/sctp')
-rw-r--r--net/sctp/socket.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index c92f96cda699..2625eccb77d5 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -6592,8 +6592,7 @@ static int sctp_msghdr_parse(const struct msghdr *msg, sctp_cmsgs_t *cmsgs)
6592 struct cmsghdr *cmsg; 6592 struct cmsghdr *cmsg;
6593 struct msghdr *my_msg = (struct msghdr *)msg; 6593 struct msghdr *my_msg = (struct msghdr *)msg;
6594 6594
6595 for (cmsg = CMSG_FIRSTHDR(msg); cmsg != NULL; 6595 for_each_cmsghdr(cmsg, my_msg) {
6596 cmsg = CMSG_NXTHDR(my_msg, cmsg)) {
6597 if (!CMSG_OK(my_msg, cmsg)) 6596 if (!CMSG_OK(my_msg, cmsg))
6598 return -EINVAL; 6597 return -EINVAL;
6599 6598