patch-2.4.3 linux/net/ipv6/reassembly.c

Next file: linux/net/ipv6/tcp_ipv6.c
Previous file: linux/net/ipv6/ipv6_sockglue.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.2/linux/net/ipv6/reassembly.c linux/net/ipv6/reassembly.c
@@ -203,18 +203,17 @@
 			if (ip6_frag_hash[i] == NULL)
 				continue;
 
-			write_lock(&ip6_frag_lock);
+			read_lock(&ip6_frag_lock);
 			if ((fq = ip6_frag_hash[i]) != NULL) {
 				/* find the oldest queue for this hash bucket */
 				while (fq->next)
 					fq = fq->next;
-				__fq_unlink(fq);
-				write_unlock(&ip6_frag_lock);
+				atomic_inc(&fq->refcnt);
+				read_unlock(&ip6_frag_lock);
 
 				spin_lock(&fq->lock);
-				if (del_timer(&fq->timer))
-					atomic_dec(&fq->refcnt);
-				fq->last_in |= COMPLETE;
+				if (!(fq->last_in&COMPLETE))
+					fq_kill(fq);
 				spin_unlock(&fq->lock);
 
 				fq_put(fq);
@@ -222,7 +221,7 @@
 				progress = 1;
 				continue;
 			}
-			write_unlock(&ip6_frag_lock);
+			read_unlock(&ip6_frag_lock);
 		}
 	} while (progress);
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)