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/ipv4 | |
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/ipv4')
-rw-r--r-- | net/ipv4/fib_frontend.c | 6 | ||||
-rw-r--r-- | net/ipv4/ipmr.c | 10 | ||||
-rw-r--r-- | net/ipv4/netfilter/ipt_ULOG.c | 4 | ||||
-rw-r--r-- | net/ipv4/udp_diag.c | 6 |
4 files changed, 13 insertions, 13 deletions
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index 0e74398bc8e6..c7629a209f9d 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c | |||
@@ -957,8 +957,8 @@ static void nl_fib_input(struct sk_buff *skb) | |||
957 | 957 | ||
958 | net = sock_net(skb->sk); | 958 | net = sock_net(skb->sk); |
959 | nlh = nlmsg_hdr(skb); | 959 | nlh = nlmsg_hdr(skb); |
960 | if (skb->len < NLMSG_SPACE(0) || skb->len < nlh->nlmsg_len || | 960 | if (skb->len < NLMSG_HDRLEN || skb->len < nlh->nlmsg_len || |
961 | nlh->nlmsg_len < NLMSG_LENGTH(sizeof(*frn))) | 961 | nlmsg_len(nlh) < sizeof(*frn)) |
962 | return; | 962 | return; |
963 | 963 | ||
964 | skb = skb_clone(skb, GFP_KERNEL); | 964 | skb = skb_clone(skb, GFP_KERNEL); |
@@ -966,7 +966,7 @@ static void nl_fib_input(struct sk_buff *skb) | |||
966 | return; | 966 | return; |
967 | nlh = nlmsg_hdr(skb); | 967 | nlh = nlmsg_hdr(skb); |
968 | 968 | ||
969 | frn = (struct fib_result_nl *) NLMSG_DATA(nlh); | 969 | frn = (struct fib_result_nl *) nlmsg_data(nlh); |
970 | tb = fib_get_table(net, frn->tb_id_in); | 970 | tb = fib_get_table(net, frn->tb_id_in); |
971 | 971 | ||
972 | nl_fib_lookup(frn, tb); | 972 | nl_fib_lookup(frn, tb); |
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index fd61fe16679f..9d9610ae7855 100644 --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c | |||
@@ -626,9 +626,9 @@ static void ipmr_destroy_unres(struct mr_table *mrt, struct mfc_cache *c) | |||
626 | if (ip_hdr(skb)->version == 0) { | 626 | if (ip_hdr(skb)->version == 0) { |
627 | struct nlmsghdr *nlh = (struct nlmsghdr *)skb_pull(skb, sizeof(struct iphdr)); | 627 | struct nlmsghdr *nlh = (struct nlmsghdr *)skb_pull(skb, sizeof(struct iphdr)); |
628 | nlh->nlmsg_type = NLMSG_ERROR; | 628 | nlh->nlmsg_type = NLMSG_ERROR; |
629 | nlh->nlmsg_len = NLMSG_LENGTH(sizeof(struct nlmsgerr)); | 629 | nlh->nlmsg_len = nlmsg_msg_size(sizeof(struct nlmsgerr)); |
630 | skb_trim(skb, nlh->nlmsg_len); | 630 | skb_trim(skb, nlh->nlmsg_len); |
631 | e = NLMSG_DATA(nlh); | 631 | e = nlmsg_data(nlh); |
632 | e->error = -ETIMEDOUT; | 632 | e->error = -ETIMEDOUT; |
633 | memset(&e->msg, 0, sizeof(e->msg)); | 633 | memset(&e->msg, 0, sizeof(e->msg)); |
634 | 634 | ||
@@ -910,14 +910,14 @@ static void ipmr_cache_resolve(struct net *net, struct mr_table *mrt, | |||
910 | if (ip_hdr(skb)->version == 0) { | 910 | if (ip_hdr(skb)->version == 0) { |
911 | struct nlmsghdr *nlh = (struct nlmsghdr *)skb_pull(skb, sizeof(struct iphdr)); | 911 | struct nlmsghdr *nlh = (struct nlmsghdr *)skb_pull(skb, sizeof(struct iphdr)); |
912 | 912 | ||
913 | if (__ipmr_fill_mroute(mrt, skb, c, NLMSG_DATA(nlh)) > 0) { | 913 | if (__ipmr_fill_mroute(mrt, skb, c, nlmsg_data(nlh)) > 0) { |
914 | nlh->nlmsg_len = skb_tail_pointer(skb) - | 914 | nlh->nlmsg_len = skb_tail_pointer(skb) - |
915 | (u8 *)nlh; | 915 | (u8 *)nlh; |
916 | } else { | 916 | } else { |
917 | nlh->nlmsg_type = NLMSG_ERROR; | 917 | nlh->nlmsg_type = NLMSG_ERROR; |
918 | nlh->nlmsg_len = NLMSG_LENGTH(sizeof(struct nlmsgerr)); | 918 | nlh->nlmsg_len = nlmsg_msg_size(sizeof(struct nlmsgerr)); |
919 | skb_trim(skb, nlh->nlmsg_len); | 919 | skb_trim(skb, nlh->nlmsg_len); |
920 | e = NLMSG_DATA(nlh); | 920 | e = nlmsg_data(nlh); |
921 | e->error = -EMSGSIZE; | 921 | e->error = -EMSGSIZE; |
922 | memset(&e->msg, 0, sizeof(e->msg)); | 922 | memset(&e->msg, 0, sizeof(e->msg)); |
923 | } | 923 | } |
diff --git a/net/ipv4/netfilter/ipt_ULOG.c b/net/ipv4/netfilter/ipt_ULOG.c index 7d168dcbd135..e7f8cad11393 100644 --- a/net/ipv4/netfilter/ipt_ULOG.c +++ b/net/ipv4/netfilter/ipt_ULOG.c | |||
@@ -37,7 +37,7 @@ | |||
37 | #include <linux/skbuff.h> | 37 | #include <linux/skbuff.h> |
38 | #include <linux/kernel.h> | 38 | #include <linux/kernel.h> |
39 | #include <linux/timer.h> | 39 | #include <linux/timer.h> |
40 | #include <linux/netlink.h> | 40 | #include <net/netlink.h> |
41 | #include <linux/netdevice.h> | 41 | #include <linux/netdevice.h> |
42 | #include <linux/mm.h> | 42 | #include <linux/mm.h> |
43 | #include <linux/moduleparam.h> | 43 | #include <linux/moduleparam.h> |
@@ -172,7 +172,7 @@ static void ipt_ulog_packet(unsigned int hooknum, | |||
172 | else | 172 | else |
173 | copy_len = loginfo->copy_range; | 173 | copy_len = loginfo->copy_range; |
174 | 174 | ||
175 | size = NLMSG_SPACE(sizeof(*pm) + copy_len); | 175 | size = nlmsg_total_size(sizeof(*pm) + copy_len); |
176 | 176 | ||
177 | ub = &ulog_buffers[groupnum]; | 177 | ub = &ulog_buffers[groupnum]; |
178 | 178 | ||
diff --git a/net/ipv4/udp_diag.c b/net/ipv4/udp_diag.c index 505b30ad9182..369a781851ad 100644 --- a/net/ipv4/udp_diag.c +++ b/net/ipv4/udp_diag.c | |||
@@ -64,9 +64,9 @@ static int udp_dump_one(struct udp_table *tbl, struct sk_buff *in_skb, | |||
64 | goto out; | 64 | goto out; |
65 | 65 | ||
66 | err = -ENOMEM; | 66 | err = -ENOMEM; |
67 | rep = alloc_skb(NLMSG_SPACE((sizeof(struct inet_diag_msg) + | 67 | rep = nlmsg_new(sizeof(struct inet_diag_msg) + |
68 | sizeof(struct inet_diag_meminfo) + | 68 | sizeof(struct inet_diag_meminfo) + 64, |
69 | 64)), GFP_KERNEL); | 69 | GFP_KERNEL); |
70 | if (!rep) | 70 | if (!rep) |
71 | goto out; | 71 | goto out; |
72 | 72 | ||