PERFORCE change 117607 for review

Christian S.J. Peron csjp at FreeBSD.org
Sat Apr 7 21:21:18 UTC 2007


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

Change 117607 by csjp at csjp_push on 2007/04/07 21:21:11

	- Change unconditonal Giant aquisition to depend on the status
	  mpsafe.net
	- Add NET_LOCK_GIANT around a call into the ifnet layer's ioctl

Affected files ...

.. //depot/projects/zcopybpf/src/sys/net/bpf.c#20 edit

Differences ...

==== //depot/projects/zcopybpf/src/sys/net/bpf.c#20 (text+ko) ====

@@ -1032,8 +1032,10 @@
 			if (d->bd_bif == NULL)
 				error = EINVAL;
 			else {
+				NET_LOCK_GIANT();
 				ifp = d->bd_bif->bif_ifp;
 				error = (*ifp->if_ioctl)(ifp, cmd, addr);
+				NET_UNLOCK_GIANT();
 			}
 			break;
 		}
@@ -1081,9 +1083,9 @@
 			break;
 		}
 		if (d->bd_promisc == 0) {
-			mtx_lock(&Giant);
+			NET_LOCK_GIANT();
 			error = ifpromisc(d->bd_bif->bif_ifp, 1);
-			mtx_unlock(&Giant);
+			NET_UNLOCK_GIANT();
 			if (error == 0)
 				d->bd_promisc = 1;
 		}


More information about the p4-projects mailing list