summaryrefslogtreecommitdiff
path: root/include/linux/netlink.h
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-04-26 06:08:35 +0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 09:26:34 +0400
commitb529ccf2799c14346d1518e9bdf1f88f03643e99 (patch)
treef899a5a5d66d2ca21724c1871ee3afeda6c4a670 /include/linux/netlink.h
parent965ffea43d4ebe8cd7b9fee78d651268dd7d23c5 (diff)
downloadlinux-b529ccf2799c14346d1518e9bdf1f88f03643e99.tar.xz
[NETLINK]: Introduce nlmsg_hdr() helper
For the common "(struct nlmsghdr *)skb->data" sequence, so that we reduce the number of direct accesses to skb->data and for consistency with all the other cast skb member helpers. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netlink.h')
-rw-r--r--include/linux/netlink.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 68a632b372ec..36629fff26d3 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -138,6 +138,11 @@ struct nlattr
#include <linux/capability.h>
#include <linux/skbuff.h>
+static inline struct nlmsghdr *nlmsg_hdr(const struct sk_buff *skb)
+{
+ return (struct nlmsghdr *)skb->data;
+}
+
struct netlink_skb_parms
{
struct ucred creds; /* Skb credentials */