diff mbox

[2/5] netlink: store MSG_CMSG_COMPAT flag in netlink_skb_parms

Message ID 1266252393-20911-3-git-send-email-fw@strlen.de
State Superseded, archived
Delegated to: David Miller
Headers show

Commit Message

Florian Westphal Feb. 15, 2010, 4:46 p.m. UTC
This allows the netlink processing context to determine if the data
needs any 32 bit fixups.

Signed-off-by: Florian Westphal <fw@strlen.de>
---
 include/linux/netlink.h  |    1 +
 net/netlink/af_netlink.c |    3 +++
 2 files changed, 4 insertions(+), 0 deletions(-)

Comments

Johannes Berg Feb. 18, 2010, 7:37 a.m. UTC | #1
On Mon, 2010-02-15 at 17:46 +0100, Florian Westphal wrote:
> This allows the netlink processing context to determine if the data
> needs any 32 bit fixups.

> --- a/include/linux/netlink.h
> +++ b/include/linux/netlink.h
> @@ -164,6 +164,7 @@ struct netlink_skb_parms {
>  	__u32			loginuid;	/* Login (audit) uid */
>  	__u32			sessionid;	/* Session id (audit) */
>  	__u32			sid;		/* SELinux security id */
> +	__u8			msg_compat;	/* Message needs 32bit fixups */

bool?

johannes
diff mbox

Patch

diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index fde27c0..8b30c01 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -164,6 +164,7 @@  struct netlink_skb_parms {
 	__u32			loginuid;	/* Login (audit) uid */
 	__u32			sessionid;	/* Session id (audit) */
 	__u32			sid;		/* SELinux security id */
+	__u8			msg_compat;	/* Message needs 32bit fixups */
 };
 
 #define NETLINK_CB(skb)		(*(struct netlink_skb_parms*)&((skb)->cb))
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 4910031..5ff97cf 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -1328,6 +1328,9 @@  static int netlink_sendmsg(struct kiocb *kiocb, struct socket *sock,
 	NETLINK_CB(skb).dst_group = dst_group;
 	NETLINK_CB(skb).loginuid = audit_get_loginuid(current);
 	NETLINK_CB(skb).sessionid = audit_get_sessionid(current);
+#ifdef CONFIG_COMPAT_NETLINK_MESSAGES
+	NETLINK_CB(skb).msg_compat = !!(msg->msg_flags & MSG_CMSG_COMPAT);
+#endif
 	security_task_getsecid(current, &(NETLINK_CB(skb).sid));
 	memcpy(NETLINK_CREDS(skb), &siocb->scm->creds, sizeof(struct ucred));