[ovs-dev] [PATCH 2/3] dpctl: Fix shadowed iterator in show_dpif().

Justin Pettit jpettit at ovn.org
Wed Jul 13 02:22:47 UTC 2016


Thanks.  Do you mind looking at the other patches, too?  I think they're pretty obviously correct.

--Justin


> On Jul 12, 2016, at 6:36 PM, Daniele Di Proietto <diproiettod at ovn.org> wrote:
> 
> Looks good to me, thanks!
> 
> Acked-by: Daniele Di Proietto <diproiettod at vmware.com>
> 
> 2016-07-12 12:19 GMT-07:00 Justin Pettit <jpettit at ovn.org>:
> Signed-off-by: Justin Pettit <jpettit at ovn.org>
> ---
>  lib/dpctl.c | 11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)
> 
> diff --git a/lib/dpctl.c b/lib/dpctl.c
> index b870e30..003602a 100644
> --- a/lib/dpctl.c
> +++ b/lib/dpctl.c
> @@ -577,13 +577,10 @@ show_dpif(struct dpif *dpif, struct dpctl_params *dpctl_p)
>                  smap_init(&config);
>                  error = netdev_get_config(netdev, &config);
>                  if (!error) {
> -                    const struct smap_node **nodes;
> -                    size_t i;
> -
> -                    nodes = smap_sort(&config);
> -                    for (i = 0; i < smap_count(&config); i++) {
> -                        const struct smap_node *node = nodes[i];
> -                        dpctl_print(dpctl_p, "%c %s=%s", i ? ',' : ':',
> +                    const struct smap_node **nodes = smap_sort(&config);
> +                    for (size_t j = 0; j < smap_count(&config); j++) {
> +                        const struct smap_node *node = nodes[j];
> +                        dpctl_print(dpctl_p, "%c %s=%s", j ? ',' : ':',
>                                      node->key, node->value);
>                      }
>                      free(nodes);
> --
> 1.9.1
> 
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
> 




More information about the dev mailing list