[ovs-dev] [PATCH] v4 vswitchd: Log all tunnel parameters of given flow.

Ben Pfaff blp at nicira.com
Thu Nov 22 00:35:39 UTC 2012


On Wed, Nov 21, 2012 at 02:54:22PM -0800, Pravin B Shelar wrote:
> +static bool
> +tun_parms_fully_wildcarded(const struct flow_wildcards *wc)
> +{

Please put {} around the return statements here, or just use:

        return (!wc->masks.tunnel.ip_src &&
                !wc->masks.tunnel.ip_dst &&
                !wc->masks.tunnel.ip_ttl &&
                !wc->masks.tunnel.ip_tos &&
                !wc->masks.tunnel.flags);

> +    if (wc->masks.tunnel.ip_src != 0)
> +            return false;
> +    if (wc->masks.tunnel.ip_dst != 0)
> +            return false;
> +    if (wc->masks.tunnel.ip_ttl != 0)
> +            return false;
> +    if (wc->masks.tunnel.ip_tos != 0)
> +            return false;
> +    if (wc->masks.tunnel.flags != 0)
> +            return false;
> +
> +    return true;
> +}

> +AT_CHECK([ovs-ofctl parse-flows flows.txt
> +], [1], [stdout], [stderr])
> +AT_CHECK([[cat stdout]], [0],
> +[[usable protocols: none
> +]])

This can be simplified to just:

    AT_CHECK([ovs-ofctl parse-flows flows.txt
    ], [1], [usable protocols: none
    ])

I don't personally see any need to look at this again, thank you for
all the revisions.



More information about the dev mailing list