On Sat, 16 Oct 2004 [EMAIL PROTECTED] wrote: > @@ -71,12 +71,14 @@ > scope6_ifattach(ifp) > struct ifnet *ifp; > { > - int s = splnet(); > + > struct scope6_id *sid; > > sid = (struct scope6_id *)malloc(sizeof(*sid), M_IFADDR, M_WAITOK); > bzero(sid, sizeof(*sid)); > > + IFNET_WLOCK(); > + > /* > * XXX: IPV6_ADDR_SCOPE_xxx macros are not standard. > * Should we rather hardcode here?
I notice that the comments indicate that you acquire the ifnet list lock to prevent the ifnet from going away; however, the caller passes in an ifnet pointer. Shouldn't it be the responsibility of the caller to make sure the ifnet doesn't go away, or it could go away before you could aquire the lock? I.e., either by virtue of the ifnet life cycle, or by virtue of the caller locking the list and these functions asserting it? Robert N M Watson FreeBSD Core Team, TrustedBSD Projects [EMAIL PROTECTED] Principal Research Scientist, McAfee Research _______________________________________________ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-net To unsubscribe, send any mail to "[EMAIL PROTECTED]"