[ovs-dev] [PATCH v9 4/6] Add set skb_mark, set_priority and tunnel support to execute_set_action

Simon Horman horms at verge.net.au
Fri May 24 05:51:11 UTC 2013


On Thu, May 23, 2013 at 11:03:50AM -0700, Ben Pfaff wrote:
> On Wed, May 22, 2013 at 04:08:08PM +0900, Simon Horman wrote:
> > +set_tunnel_action(const struct nlattr *a, struct flow_tnl *tun_key)
> > +{
> > +    enum odp_key_fitness fitness = tun_key_from_attr(a, tun_key);
> > +
> > +    memset(&tun_key, 0, sizeof tun_key);
> > +    ovs_assert(fitness != ODP_FIT_ERROR);
> > +}
> 
> I don't understand the above code, at all.  The memset call apparently
> means to zero out '*tun_key' (and throw away the conversion work we
> just did) but the way it's written it only zeros out the pointer to
> '*tun_key'.  Either way, it doesn't make sense.

Sorry about that. I believe that the memset() should be removed entirely.
I can only assume it is left over from some debugging I was doing.

> > +enum odp_key_fitness
> > +tun_key_from_attr(const struct nlattr *attr, struct flow_tnl *tun);
> 
> We don't put the return type on a separate line for a prototype, and
> the parameter names shouldn't be used in this case, please see
> CodingStyle.

Thanks, I will fix that.



More information about the dev mailing list