X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fdpif-linux.c;h=fcf6899c032e3792beaa3ca07e2b5d80ba0ec001;hb=41792464296d4ea9393adff3eea7bef514655cba;hp=b571441f587e90c44b7961c445c63243f6049dc9;hpb=14b4d2f99f861e63093ce684e8073ba6e878243b;p=openvswitch diff --git a/lib/dpif-linux.c b/lib/dpif-linux.c index b571441f..fcf6899c 100644 --- a/lib/dpif-linux.c +++ b/lib/dpif-linux.c @@ -968,24 +968,38 @@ dpif_linux_operate__(struct dpif *dpif_, struct dpif_op **ops, size_t n_ops) switch (op->type) { case DPIF_OP_FLOW_PUT: put = &op->u.flow_put; - if (!op->error && put->stats) { - struct dpif_linux_flow reply; - - op->error = dpif_linux_flow_from_ofpbuf(&reply, txn->reply); + if (put->stats) { if (!op->error) { - dpif_linux_flow_get_stats(&reply, put->stats); + struct dpif_linux_flow reply; + + op->error = dpif_linux_flow_from_ofpbuf(&reply, + txn->reply); + if (!op->error) { + dpif_linux_flow_get_stats(&reply, put->stats); + } + } + + if (op->error) { + memset(put->stats, 0, sizeof *put->stats); } } break; case DPIF_OP_FLOW_DEL: del = &op->u.flow_del; - if (!op->error && del->stats) { - struct dpif_linux_flow reply; - - op->error = dpif_linux_flow_from_ofpbuf(&reply, txn->reply); + if (del->stats) { if (!op->error) { - dpif_linux_flow_get_stats(&reply, del->stats); + struct dpif_linux_flow reply; + + op->error = dpif_linux_flow_from_ofpbuf(&reply, + txn->reply); + if (!op->error) { + dpif_linux_flow_get_stats(&reply, del->stats); + } + } + + if (op->error) { + memset(del->stats, 0, sizeof *del->stats); } } break; @@ -1981,7 +1995,7 @@ report_loss(struct dpif *dpif_, struct dpif_channel *ch) } ds_chomp(&s, ','); - VLOG_ERR("%s: lost packet on channel %d%s", + VLOG_ERR("%s: lost packet on channel %td%s", dpif_name(dpif_), ch - dpif->channels, ds_cstr(&s)); ds_destroy(&s); }