diff options
author | David S. Miller <davem@davemloft.net> | 2012-06-27 00:47:21 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-27 00:54:15 -0400 |
commit | 3f7a3283ccfa59e0dbbc59a6710bd37ba44d4333 (patch) | |
tree | 6b0ef234bef3616b0009cab4029dde61fdf8c8e4 /net/decnet | |
parent | 737100e1622360b3de10550a15faf095547d972a (diff) |
decnet: dn_table: Move away from NLMSG_NEW().
And use nlmsg_data() while we're here too.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/decnet')
-rw-r--r-- | net/decnet/dn_table.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/net/decnet/dn_table.c b/net/decnet/dn_table.c index 650f3380c98a..92ec7417a4d9 100644 --- a/net/decnet/dn_table.c +++ b/net/decnet/dn_table.c | |||
@@ -299,8 +299,10 @@ static int dn_fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event, | |||
299 | struct nlmsghdr *nlh; | 299 | struct nlmsghdr *nlh; |
300 | unsigned char *b = skb_tail_pointer(skb); | 300 | unsigned char *b = skb_tail_pointer(skb); |
301 | 301 | ||
302 | nlh = NLMSG_NEW(skb, pid, seq, event, sizeof(*rtm), flags); | 302 | nlh = nlmsg_put(skb, pid, seq, event, sizeof(*rtm), flags); |
303 | rtm = NLMSG_DATA(nlh); | 303 | if (!nlh) |
304 | goto out_nlmsg_trim; | ||
305 | rtm = nlmsg_data(nlh); | ||
304 | rtm->rtm_family = AF_DECnet; | 306 | rtm->rtm_family = AF_DECnet; |
305 | rtm->rtm_dst_len = dst_len; | 307 | rtm->rtm_dst_len = dst_len; |
306 | rtm->rtm_src_len = 0; | 308 | rtm->rtm_src_len = 0; |
@@ -348,8 +350,7 @@ static int dn_fib_dump_info(struct sk_buff *skb, u32 pid, u32 seq, int event, | |||
348 | nlh->nlmsg_len = skb_tail_pointer(skb) - b; | 350 | nlh->nlmsg_len = skb_tail_pointer(skb) - b; |
349 | return skb->len; | 351 | return skb->len; |
350 | 352 | ||
351 | 353 | out_nlmsg_trim: | |
352 | nlmsg_failure: | ||
353 | rtattr_failure: | 354 | rtattr_failure: |
354 | nlmsg_trim(skb, b); | 355 | nlmsg_trim(skb, b); |
355 | return -EMSGSIZE; | 356 | return -EMSGSIZE; |
@@ -476,7 +477,7 @@ int dn_fib_dump(struct sk_buff *skb, struct netlink_callback *cb) | |||
476 | return 0; | 477 | return 0; |
477 | 478 | ||
478 | if (NLMSG_PAYLOAD(cb->nlh, 0) >= sizeof(struct rtmsg) && | 479 | if (NLMSG_PAYLOAD(cb->nlh, 0) >= sizeof(struct rtmsg) && |
479 | ((struct rtmsg *)NLMSG_DATA(cb->nlh))->rtm_flags&RTM_F_CLONED) | 480 | ((struct rtmsg *)nlmsg_data(cb->nlh))->rtm_flags&RTM_F_CLONED) |
480 | return dn_cache_dump(skb, cb); | 481 | return dn_cache_dump(skb, cb); |
481 | 482 | ||
482 | s_h = cb->args[0]; | 483 | s_h = cb->args[0]; |