[ovs-dev] [ovn-controller-vtep V6 6/7] ovn-controller-vtep: Extend vtep module to install Ucast_Macs_Remote.

Russell Bryant rbryant at redhat.com
Mon Aug 17 13:37:33 UTC 2015


On 08/16/2015 07:24 PM, Alex Wang wrote:
> 
> 
> On Sun, Aug 16, 2015 at 3:26 PM, Russell Bryant <rbryant at redhat.com
> <mailto:rbryant at redhat.com>> wrote:
> 
>     On 08/09/2015 10:50 PM, Alex Wang wrote:
>     > +        tnl_key = port_binding_rec->datapath->tunnel_key;
>     > +        HMAP_FOR_EACH_WITH_HASH (ls_node, hmap_node,
>     > +                                 hash_uint64((uint64_t) tnl_key),
>     > +                                 &ls_map) {
>     > +            if (ls_node->vtep_ls->tunnel_key[0] == tnl_key) {
>     > +                break;
>     > +            }
>     > +        }
>     > +        /* If 'ls_node' is NULL, that means no vtep logical switch is
>     > +         * attached to the corresponding ovn logical datapath, so pass. */
>     > +        if (!ls_node) {
>     > +            continue;
>     > +        }
> 
>     I don't think ls_node is guaranteed to be NULL here, even when the loop
>     ends normally (without a break).
> 
> 
> Could you explain more about this concern?  From the comments in 
> lib/hmap.h, this looks okay to me.

Ah, you're right.  It's fine since hmap_node is the first member in the
struct.  Thanks.

It might be worth a comment in your struct definition saying that
hmap_node must remain the first struct member.

-- 
Russell Bryant



More information about the dev mailing list