aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/fib_frontend.c6
-rw-r--r--net/ipv4/inet_fragment.c5
-rw-r--r--net/ipv4/ipmr.c10
-rw-r--r--net/ipv4/netfilter/ipt_ULOG.c4
-rw-r--r--net/ipv4/tcp_input.c7
-rw-r--r--net/ipv4/udp_diag.c6
6 files changed, 18 insertions, 20 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/inet_fragment.c b/net/ipv4/inet_fragment.c
index 2bff045bec60..1206ca64b0ea 100644
--- a/net/ipv4/inet_fragment.c
+++ b/net/ipv4/inet_fragment.c
@@ -124,7 +124,6 @@ static inline void fq_unlink(struct inet_frag_queue *fq, struct inet_frags *f)
124{ 124{
125 write_lock(&f->lock); 125 write_lock(&f->lock);
126 hlist_del(&fq->list); 126 hlist_del(&fq->list);
127 fq->net->nqueues--;
128 write_unlock(&f->lock); 127 write_unlock(&f->lock);
129 inet_frag_lru_del(fq); 128 inet_frag_lru_del(fq);
130} 129}
@@ -204,6 +203,9 @@ int inet_frag_evictor(struct netns_frags *nf, struct inet_frags *f, bool force)
204 q = list_first_entry(&nf->lru_list, 203 q = list_first_entry(&nf->lru_list,
205 struct inet_frag_queue, lru_list); 204 struct inet_frag_queue, lru_list);
206 atomic_inc(&q->refcnt); 205 atomic_inc(&q->refcnt);
206 /* Remove q from list to avoid several CPUs grabbing it */
207 list_del_init(&q->lru_list);
208
207 spin_unlock(&nf->lru_lock); 209 spin_unlock(&nf->lru_lock);
208 210
209 spin_lock(&q->lock); 211 spin_lock(&q->lock);
@@ -257,7 +259,6 @@ static struct inet_frag_queue *inet_frag_intern(struct netns_frags *nf,
257 259
258 atomic_inc(&qp->refcnt); 260 atomic_inc(&qp->refcnt);
259 hlist_add_head(&qp->list, &f->hash[hash]); 261 hlist_add_head(&qp->list, &f->hash[hash]);
260 nf->nqueues++;
261 write_unlock(&f->lock); 262 write_unlock(&f->lock);
262 inet_frag_lru_add(nf, qp); 263 inet_frag_lru_add(nf, qp);
263 return qp; 264 return qp;
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/tcp_input.c b/net/ipv4/tcp_input.c
index b2b36196b342..6d9ca35f0c35 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1858,11 +1858,8 @@ void tcp_enter_loss(struct sock *sk, int how)
1858 if (tcp_is_reno(tp)) 1858 if (tcp_is_reno(tp))
1859 tcp_reset_reno_sack(tp); 1859 tcp_reset_reno_sack(tp);
1860 1860
1861 if (!how) { 1861 tp->undo_marker = tp->snd_una;
1862 /* Push undo marker, if it was plain RTO and nothing 1862 if (how) {
1863 * was retransmitted. */
1864 tp->undo_marker = tp->snd_una;
1865 } else {
1866 tp->sacked_out = 0; 1863 tp->sacked_out = 0;
1867 tp->fackets_out = 0; 1864 tp->fackets_out = 0;
1868 } 1865 }
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