[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>
This commit is contained in:
committed by
David S. Miller
parent
965ffea43d
commit
b529ccf279
@@ -102,7 +102,7 @@ static unsigned int dnrmg_hook(unsigned int hook,
|
||||
|
||||
static inline void dnrmg_receive_user_skb(struct sk_buff *skb)
|
||||
{
|
||||
struct nlmsghdr *nlh = (struct nlmsghdr *)skb->data;
|
||||
struct nlmsghdr *nlh = nlmsg_hdr(skb);
|
||||
|
||||
if (nlh->nlmsg_len < sizeof(*nlh) || skb->len < nlh->nlmsg_len)
|
||||
return;
|
||||
|
Reference in New Issue
Block a user