[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
@@ -97,7 +97,7 @@ out:
|
||||
*/
|
||||
static int ecryptfs_process_nl_response(struct sk_buff *skb)
|
||||
{
|
||||
struct nlmsghdr *nlh = (struct nlmsghdr*)skb->data;
|
||||
struct nlmsghdr *nlh = nlmsg_hdr(skb);
|
||||
struct ecryptfs_message *msg = NLMSG_DATA(nlh);
|
||||
int rc;
|
||||
|
||||
@@ -181,7 +181,7 @@ receive:
|
||||
"rc = [%d]\n", rc);
|
||||
return;
|
||||
}
|
||||
nlh = (struct nlmsghdr *)skb->data;
|
||||
nlh = nlmsg_hdr(skb);
|
||||
if (!NLMSG_OK(nlh, skb->len)) {
|
||||
ecryptfs_printk(KERN_ERR, "Received corrupt netlink "
|
||||
"message\n");
|
||||
|
Reference in New Issue
Block a user