@@ -5468,7 +5468,7 @@ handle_flow_mod(struct ofconn *ofconn, const struct ofp_header *oh)
error = reject_slave_controller(ofconn);
if (error) {
- goto exit;
+ return error;
}
ofpbuf_use_stub(&ofpacts, ofpacts_stub, sizeof ofpacts_stub);
@@ -5480,15 +5480,8 @@ handle_flow_mod(struct ofconn *ofconn, const struct ofp_header *oh)
struct openflow_mod_requester req = { ofconn, oh };
error = handle_flow_mod__(ofproto, &ofm, &req);
}
- if (error) {
- goto exit_free_ofpacts;
- }
- ofconn_report_flow_mod(ofconn, ofm.fm.command);
-
-exit_free_ofpacts:
ofpbuf_uninit(&ofpacts);
-exit:
return error;
}
@@ -7057,6 +7050,10 @@ ofproto_flow_mod_finish(struct ofproto *ofproto,
default:
break;
}
+
+ if (req) {
+ ofconn_report_flow_mod(req->ofconn, ofm->fm.command);
+ }
}
/* Commit phases (all while locking ofproto_mutex):
Flow mod stats get skewed if they are not reported from bundles. Move reporting to ofproto_flow_mod_finish() so that it will be done in all cases. Signed-off-by: Jarno Rajahalme <jarno@ovn.org> --- ofproto/ofproto.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-)