aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
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/ipv4
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/ipv4')
-rw-r--r--net/ipv4/ip_sockglue.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
index 640f26c6a9fe..8a89c738b7a3 100644
--- a/net/ipv4/ip_sockglue.c
+++ b/net/ipv4/ip_sockglue.c
@@ -192,7 +192,7 @@ int ip_cmsg_send(struct net *net, struct msghdr *msg, struct ipcm_cookie *ipc,
192 int err, val; 192 int err, val;
193 struct cmsghdr *cmsg; 193 struct cmsghdr *cmsg;
194 194
195 for (cmsg = CMSG_FIRSTHDR(msg); cmsg; cmsg = CMSG_NXTHDR(msg, cmsg)) { 195 for_each_cmsghdr(cmsg, msg) {
196 if (!CMSG_OK(msg, cmsg)) 196 if (!CMSG_OK(msg, cmsg))
197 return -EINVAL; 197 return -EINVAL;
198#if IS_ENABLED(CONFIG_IPV6) 198#if IS_ENABLED(CONFIG_IPV6)