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. _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev