On 08/16/2015 07:24 PM, Alex Wang wrote:
> 
> 
> On Sun, Aug 16, 2015 at 3:26 PM, Russell Bryant <rbry...@redhat.com
> <mailto:rbry...@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
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to