On Tue, Nov 01, 2005 at 10:23:56AM -0500, James Morris wrote:
> On Tue, 1 Nov 2005, Herbert Xu wrote:
> 
> > > + if (dir == FLOW_DIR_IN)
> > > +         read_lock_bh(&sk->sk_callback_lock);
> > 
> > You've probably explained this already, but I wasn't paying attention :)
> > Why is the lock only needed for inbound packets?
> 
> I've previously audited the code paths and determined that this lock is 
> only needed for inbound packets (otherwise you have a race with 
> sock_orphan() if the socket is closed while the packet is arriving).  For 
> outbound sockets, I believe that a reference is held all the way down the 
> IP stack.

OK, but what if the packet is queued for things like ARP or NF_QUEUE?
Is the lock still held after they come back?

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to