aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/reassembly.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/reassembly.c')
-rw-r--r--net/ipv6/reassembly.c30
1 files changed, 4 insertions, 26 deletions
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index 940b7d2383ec..02e4e855b927 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -185,33 +185,11 @@ static __inline__ void fq_kill(struct frag_queue *fq)
185 185
186static void ip6_evictor(struct inet6_dev *idev) 186static void ip6_evictor(struct inet6_dev *idev)
187{ 187{
188 struct frag_queue *fq; 188 int evicted;
189 struct list_head *tmp;
190 int work;
191
192 work = atomic_read(&ip6_frags.mem) - ip6_frags_ctl.low_thresh;
193 if (work <= 0)
194 return;
195
196 while(work > 0) {
197 read_lock(&ip6_frags.lock);
198 if (list_empty(&ip6_frags.lru_list)) {
199 read_unlock(&ip6_frags.lock);
200 return;
201 }
202 tmp = ip6_frags.lru_list.next;
203 fq = list_entry(tmp, struct frag_queue, q.lru_list);
204 atomic_inc(&fq->q.refcnt);
205 read_unlock(&ip6_frags.lock);
206 189
207 spin_lock(&fq->q.lock); 190 evicted = inet_frag_evictor(&ip6_frags);
208 if (!(fq->q.last_in&COMPLETE)) 191 if (evicted)
209 fq_kill(fq); 192 IP6_ADD_STATS_BH(idev, IPSTATS_MIB_REASMFAILS, evicted);
210 spin_unlock(&fq->q.lock);
211
212 fq_put(fq, &work);
213 IP6_INC_STATS_BH(idev, IPSTATS_MIB_REASMFAILS);
214 }
215} 193}
216 194
217static void ip6_frag_expire(unsigned long data) 195static void ip6_frag_expire(unsigned long data)