[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
@@ -807,7 +807,7 @@ static void nl_fib_input(struct sock *sk, int len)
|
||||
if (skb == NULL)
|
||||
return;
|
||||
|
||||
nlh = (struct nlmsghdr *)skb->data;
|
||||
nlh = nlmsg_hdr(skb);
|
||||
if (skb->len < NLMSG_SPACE(0) || skb->len < nlh->nlmsg_len ||
|
||||
nlh->nlmsg_len < NLMSG_LENGTH(sizeof(*frn))) {
|
||||
kfree_skb(skb);
|
||||
|
Reference in New Issue
Block a user