Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Apr 2007 21:21:17 GMT
From:      "Christian S.J. Peron" <csjp@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 117607 for review
Message-ID:  <200704072121.l37LLHTq040797@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=117607

Change 117607 by csjp@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;
 		}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200704072121.l37LLHTq040797>