PERFORCE change 37532 for review

Sam Leffler sam at FreeBSD.org
Thu Sep 4 14:45:18 PDT 2003


http://perforce.freebsd.org/chv.cgi?CH=37532

Change 37532 by sam at sam_ebb on 2003/09/04 14:44:21

	Reduce window during which a race can occur when detaching
	an interface from each descriptor that references it. This
	is just a bandaid; the locking here is bogus.

Affected files ...

.. //depot/projects/netperf/sys/net/bpf.c#5 edit

Differences ...

==== //depot/projects/netperf/sys/net/bpf.c#5 (text+ko) ====

@@ -278,7 +278,9 @@
 	struct bpf_d **p;
 	struct bpf_if *bp;
 
+	/* XXX locking */
 	bp = d->bd_bif;
+	d->bd_bif = 0;
 	/*
 	 * Check if this descriptor had requested promiscuous mode.
 	 * If so, turn it off.
@@ -310,9 +312,8 @@
 		/*
 		 * Let the driver know that there are no more listeners.
 		 */
-		*d->bd_bif->bif_driverp = 0;
+		*bp->bif_driverp = 0;
 	BPFIF_UNLOCK(bp);
-	d->bd_bif = 0;
 }
 
 /*


More information about the p4-projects mailing list