On Sat, Jul 07, 2012 at 03:25:28PM -0700, Justin Pettit wrote: > On Jul 6, 2012, at 2:49 PM, Ben Pfaff wrote: > > > @@ -873,7 +875,8 @@ struct rconn_packet_counter * > > rconn_packet_counter_create(void) > > { > > struct rconn_packet_counter *c = xmalloc(sizeof *c); > > - c->n = 0; > > + c->n_packets = 0; > > + c->n_bytes = 0; > > c->ref_cnt = 1; > > Do you think it's just worth calling xzalloc() at this point?
I'm ambivalent, so I changed it: diff --git a/lib/rconn.c b/lib/rconn.c index 0a41d51..1129a3b 100644 --- a/lib/rconn.c +++ b/lib/rconn.c @@ -874,9 +874,7 @@ rconn_count_txqlen(const struct rconn *rc) struct rconn_packet_counter * rconn_packet_counter_create(void) { - struct rconn_packet_counter *c = xmalloc(sizeof *c); - c->n_packets = 0; - c->n_bytes = 0; + struct rconn_packet_counter *c = xzalloc(sizeof *c); c->ref_cnt = 1; return c; } _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev