It is possible that a bundle add message fails, but the following commit succeeds, since the message was not added to the bundle. Make ovs-ofctl fail also in these cases.
Signed-off-by: Jarno Rajahalme <ja...@ovn.org> --- utilities/ovs-ofctl.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c index e373aa4..b04c063 100644 --- a/utilities/ovs-ofctl.c +++ b/utilities/ovs-ofctl.c @@ -660,9 +660,12 @@ transact_multiple_noreply(struct vconn *vconn, struct ovs_list *requests) ofpbuf_delete(reply); } +static bool bundle_error = false; + static void bundle_error_reporter(const struct ofp_header *oh) { + bundle_error = true; ofp_print(stderr, oh, ntohs(oh->length), verbosity + 1); fflush(stderr); } @@ -670,8 +673,14 @@ bundle_error_reporter(const struct ofp_header *oh) static void bundle_transact(struct vconn *vconn, struct ovs_list *requests, uint16_t flags) { - run(vconn_bundle_transact(vconn, requests, flags, bundle_error_reporter), - "talking to %s", vconn_get_name(vconn)); + int retval = vconn_bundle_transact(vconn, requests, flags, + bundle_error_reporter); + if (retval || bundle_error) { + if (!retval) { + retval = EPROTO; + } + ovs_fatal(retval, "talking to %s", vconn_get_name(vconn)); + } } /* Sends 'request', which should be a request that only has a reply if an error -- 2.1.4 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev