summaryrefslogtreecommitdiff
path: root/include/linux/socket.h
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2004-12-20 02:40:03 -0500
committerLen Brown <len.brown@intel.com>2004-12-20 02:40:03 -0500
commitd5d4cbf800d2def1dc937afdf510b968e5beb0c0 (patch)
tree0045ebeede42a289892e8a8bb4e85c44c029b197 /include/linux/socket.h
parenta3c76a77886d824ee896b1548104552bbb47e7e5 (diff)
parent6484567f9f24417999208f2fbb018be555b1d810 (diff)
Merge intel.com:/home/lenb/bk/26-latest-ref
into intel.com:/home/lenb/src/26-latest-dev
Diffstat (limited to 'include/linux/socket.h')
-rw-r--r--include/linux/socket.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/socket.h b/include/linux/socket.h
index b3aef7bf1380..4c7d11301abf 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -90,6 +90,10 @@ struct cmsghdr {
(struct cmsghdr *)(ctl) : \
(struct cmsghdr *)NULL)
#define CMSG_FIRSTHDR(msg) __CMSG_FIRSTHDR((msg)->msg_control, (msg)->msg_controllen)
+#define CMSG_OK(mhdr, cmsg) ((cmsg)->cmsg_len >= sizeof(struct cmsghdr) && \
+ (cmsg)->cmsg_len <= (unsigned long) \
+ ((mhdr)->msg_controllen - \
+ ((char *)(cmsg) - (char *)(mhdr)->msg_control)))
/*
* This mess will go away with glibc