Dan McDonald writes:
> > The queue in ill_wq should be valid as long as the ill_t is around.
> > The actual contents of that pointed-to structure doesn't have the same
> > guarantee.
> 
> All ops I do are while I hold a reference to ill.  In my original code
> fragment, I don't ill_refrele() until I'm finished.

It's not the reference to the ill that I'm worried about.  It's the
composition of that stream.

> Thanks for the warning - I'll be sure to turn the "YIKE" line into:
> 
>       tun = carefully_find_tun(v4);
> 
> where carefully_find_tun():
> 
>       - Is safe because "v4" is reference-held.
> 
>       - Will have a number-of-modules-traversed limit.

Why?

>       - Will insure that it finds "tun", as opposed to some other module.

That's good, but I don't think it's sufficient.  I think you must also
freeze the stream so that q_next remains stable while you walk the
list.

-- 
James Carlson, KISS Network                    <[EMAIL PROTECTED]>
Sun Microsystems / 1 Network Drive         71.232W   Vox +1 781 442 2084
MS UBUR02-212 / Burlington MA 01803-2757   42.496N   Fax +1 781 442 1677
_______________________________________________
networking-discuss mailing list
[email protected]

Reply via email to