diff options
author | Hong zhi guo <honkiko@gmail.com> | 2013-03-27 02:47:04 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-03-28 14:25:25 -0400 |
commit | 573ce260b385a4d14a1ef046558fad9f1daeee42 (patch) | |
tree | b577de870934c583a66514b1206964fbd262c340 /net/decnet | |
parent | e5c5d22e8dcf7c2d430336cbf8e180bd38e8daf1 (diff) |
net-next: replace obsolete NLMSG_* with type safe nlmsg_*
Signed-off-by: Hong Zhiguo <honkiko@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/decnet')
-rw-r--r-- | net/decnet/dn_table.c | 4 | ||||
-rw-r--r-- | net/decnet/netfilter/dn_rtmsg.c | 12 |
2 files changed, 8 insertions, 8 deletions
diff --git a/net/decnet/dn_table.c b/net/decnet/dn_table.c index fc42a0afd306..b15c1d1720fb 100644 --- a/net/decnet/dn_table.c +++ b/net/decnet/dn_table.c | |||
@@ -19,7 +19,7 @@ | |||
19 | #include <linux/sockios.h> | 19 | #include <linux/sockios.h> |
20 | #include <linux/init.h> | 20 | #include <linux/init.h> |
21 | #include <linux/skbuff.h> | 21 | #include <linux/skbuff.h> |
22 | #include <linux/netlink.h> | 22 | #include <net/netlink.h> |
23 | #include <linux/rtnetlink.h> | 23 | #include <linux/rtnetlink.h> |
24 | #include <linux/proc_fs.h> | 24 | #include <linux/proc_fs.h> |
25 | #include <linux/netdevice.h> | 25 | #include <linux/netdevice.h> |
@@ -492,7 +492,7 @@ int dn_fib_dump(struct sk_buff *skb, struct netlink_callback *cb) | |||
492 | if (!net_eq(net, &init_net)) | 492 | if (!net_eq(net, &init_net)) |
493 | return 0; | 493 | return 0; |
494 | 494 | ||
495 | if (NLMSG_PAYLOAD(cb->nlh, 0) >= sizeof(struct rtmsg) && | 495 | if (nlmsg_len(cb->nlh) >= sizeof(struct rtmsg) && |
496 | ((struct rtmsg *)nlmsg_data(cb->nlh))->rtm_flags&RTM_F_CLONED) | 496 | ((struct rtmsg *)nlmsg_data(cb->nlh))->rtm_flags&RTM_F_CLONED) |
497 | return dn_cache_dump(skb, cb); | 497 | return dn_cache_dump(skb, cb); |
498 | 498 | ||
diff --git a/net/decnet/netfilter/dn_rtmsg.c b/net/decnet/netfilter/dn_rtmsg.c index dfe42012a044..2a7efe388344 100644 --- a/net/decnet/netfilter/dn_rtmsg.c +++ b/net/decnet/netfilter/dn_rtmsg.c | |||
@@ -19,7 +19,7 @@ | |||
19 | #include <linux/netdevice.h> | 19 | #include <linux/netdevice.h> |
20 | #include <linux/netfilter.h> | 20 | #include <linux/netfilter.h> |
21 | #include <linux/spinlock.h> | 21 | #include <linux/spinlock.h> |
22 | #include <linux/netlink.h> | 22 | #include <net/netlink.h> |
23 | #include <linux/netfilter_decnet.h> | 23 | #include <linux/netfilter_decnet.h> |
24 | 24 | ||
25 | #include <net/sock.h> | 25 | #include <net/sock.h> |
@@ -39,21 +39,21 @@ static struct sk_buff *dnrmg_build_message(struct sk_buff *rt_skb, int *errp) | |||
39 | unsigned char *ptr; | 39 | unsigned char *ptr; |
40 | struct nf_dn_rtmsg *rtm; | 40 | struct nf_dn_rtmsg *rtm; |
41 | 41 | ||
42 | size = NLMSG_SPACE(rt_skb->len); | 42 | size = NLMSG_ALIGN(rt_skb->len) + |
43 | size += NLMSG_ALIGN(sizeof(struct nf_dn_rtmsg)); | 43 | NLMSG_ALIGN(sizeof(struct nf_dn_rtmsg)); |
44 | skb = alloc_skb(size, GFP_ATOMIC); | 44 | skb = nlmsg_new(size, GFP_ATOMIC); |
45 | if (!skb) { | 45 | if (!skb) { |
46 | *errp = -ENOMEM; | 46 | *errp = -ENOMEM; |
47 | return NULL; | 47 | return NULL; |
48 | } | 48 | } |
49 | old_tail = skb->tail; | 49 | old_tail = skb->tail; |
50 | nlh = nlmsg_put(skb, 0, 0, 0, size - sizeof(*nlh), 0); | 50 | nlh = nlmsg_put(skb, 0, 0, 0, size, 0); |
51 | if (!nlh) { | 51 | if (!nlh) { |
52 | kfree_skb(skb); | 52 | kfree_skb(skb); |
53 | *errp = -ENOMEM; | 53 | *errp = -ENOMEM; |
54 | return NULL; | 54 | return NULL; |
55 | } | 55 | } |
56 | rtm = (struct nf_dn_rtmsg *)NLMSG_DATA(nlh); | 56 | rtm = (struct nf_dn_rtmsg *)nlmsg_data(nlh); |
57 | rtm->nfdn_ifindex = rt_skb->dev->ifindex; | 57 | rtm->nfdn_ifindex = rt_skb->dev->ifindex; |
58 | ptr = NFDN_RTMSG(rtm); | 58 | ptr = NFDN_RTMSG(rtm); |
59 | skb_copy_from_linear_data(rt_skb, ptr, rt_skb->len); | 59 | skb_copy_from_linear_data(rt_skb, ptr, rt_skb->len); |