Commit 737100e1 authored by David S. Miller's avatar David S. Miller

decnet: dn_route: Move away from NLMSG_NEW().

And use nlmsg_data() while we're here too.
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c64e66c6
...@@ -1518,8 +1518,10 @@ static int dn_rt_fill_info(struct sk_buff *skb, u32 pid, u32 seq, ...@@ -1518,8 +1518,10 @@ static int dn_rt_fill_info(struct sk_buff *skb, u32 pid, u32 seq,
unsigned char *b = skb_tail_pointer(skb); unsigned char *b = skb_tail_pointer(skb);
long expires; long expires;
nlh = NLMSG_NEW(skb, pid, seq, event, sizeof(*r), flags); nlh = nlmsg_put(skb, pid, seq, event, sizeof(*r), flags);
r = NLMSG_DATA(nlh); if (!nlh)
goto out_nlmsg_trim;
r = nlmsg_data(nlh);
r->rtm_family = AF_DECnet; r->rtm_family = AF_DECnet;
r->rtm_dst_len = 16; r->rtm_dst_len = 16;
r->rtm_src_len = 0; r->rtm_src_len = 0;
...@@ -1559,7 +1561,7 @@ static int dn_rt_fill_info(struct sk_buff *skb, u32 pid, u32 seq, ...@@ -1559,7 +1561,7 @@ static int dn_rt_fill_info(struct sk_buff *skb, u32 pid, u32 seq,
nlh->nlmsg_len = skb_tail_pointer(skb) - b; nlh->nlmsg_len = skb_tail_pointer(skb) - b;
return skb->len; return skb->len;
nlmsg_failure: out_nlmsg_trim:
rtattr_failure: rtattr_failure:
nlmsg_trim(skb, b); nlmsg_trim(skb, b);
return -1; return -1;
...@@ -1572,7 +1574,7 @@ static int dn_cache_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh, void ...@@ -1572,7 +1574,7 @@ static int dn_cache_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh, void
{ {
struct net *net = sock_net(in_skb->sk); struct net *net = sock_net(in_skb->sk);
struct rtattr **rta = arg; struct rtattr **rta = arg;
struct rtmsg *rtm = NLMSG_DATA(nlh); struct rtmsg *rtm = nlmsg_data(nlh);
struct dn_route *rt = NULL; struct dn_route *rt = NULL;
struct dn_skb_cb *cb; struct dn_skb_cb *cb;
int err; int err;
...@@ -1669,7 +1671,7 @@ int dn_cache_dump(struct sk_buff *skb, struct netlink_callback *cb) ...@@ -1669,7 +1671,7 @@ int dn_cache_dump(struct sk_buff *skb, struct netlink_callback *cb)
if (NLMSG_PAYLOAD(cb->nlh, 0) < sizeof(struct rtmsg)) if (NLMSG_PAYLOAD(cb->nlh, 0) < sizeof(struct rtmsg))
return -EINVAL; return -EINVAL;
if (!(((struct rtmsg *)NLMSG_DATA(cb->nlh))->rtm_flags&RTM_F_CLONED)) if (!(((struct rtmsg *)nlmsg_data(cb->nlh))->rtm_flags&RTM_F_CLONED))
return 0; return 0;
s_h = cb->args[0]; s_h = cb->args[0];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment