On 2/16/22 15:27, Adrian Moreno wrote:
> The _SAFE version of the iterator allows the user to free the iterator
> structure safely.
> 
> Signed-off-by: Adrian Moreno <[email protected]>
> ---
>  vtep/vtep-ctl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/vtep/vtep-ctl.c b/vtep/vtep-ctl.c
> index 99c4adcd5..685b0007a 100644
> --- a/vtep/vtep-ctl.c
> +++ b/vtep/vtep-ctl.c
> @@ -738,7 +738,7 @@ del_ploc_from_mcast_mac(struct vtep_ctl_mcast_mac 
> *mcast_mac,
>  {
>      struct vtep_ctl_ploc *ploc;
>  
> -    LIST_FOR_EACH (ploc, locators_node, &mcast_mac->locators) {
> +    LIST_FOR_EACH_SAFE (ploc, locators_node, &mcast_mac->locators) {
>          if (ploc->ploc_cfg == ploc_cfg) {
>              ovs_list_remove(&ploc->locators_node);
>              free(ploc);

Why is this really needed?

For reference, the complete function was:

static void
del_ploc_from_mcast_mac(struct vtep_ctl_mcast_mac *mcast_mac,
                        struct vteprec_physical_locator *ploc_cfg)
{
    struct vtep_ctl_ploc *ploc;

    LIST_FOR_EACH_SAFE (ploc, locators_node, &mcast_mac->locators) {
        if (ploc->ploc_cfg == ploc_cfg) {
            ovs_list_remove(&ploc->locators_node);
            free(ploc);
            return;
        }
    }
}

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to