On Mon, Mar 13, 2006 at 05:37:12PM -0800, Darren Reed wrote:
> 
> What about if you do an ill_get_ifindex_byname() and then call
> ill_lookup_on_ifindex() ?

But looking up the second one shows me that I can get away with q == NULL,
including for the function I originally asked for.

This is not obvious from the code when I see:

        GRAB_CONN_LOCK(q);
        mutex_enter(&ill->ill_lock);
        if (ILL_CAN_LOOKUP(ill)) {
                 ill_refhold_locked(ill);
                mutex_exit(&ill->ill_lock);
                RELEASE_CONN_LOCK(q);
                return (ill);
       } else if (ILL_CAN_WAIT(ill, q)) {
              ipsq = ill->ill_phyint->phyint_ipsq;
             mutex_enter(&ipsq->ipsq_lock);

....

Because when I see macros on 'q', I assume they're being used.  Instead, I
see lots of macro definitions with:

        if ((q != NULL) && ...)
                /* DO SOMETHING */

I think we need a *hair* more documentation about this in the code.  Maybe
I'll do so as a side-effect of Tunnel Reform.

Thanks for pointing me in the right direction, Darren.  We just need to make
this clearer, it seems.

Dan
_______________________________________________
networking-discuss mailing list
[email protected]

Reply via email to