X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=utilities%2Fovs-ofctl.c;h=fd0829eaa42922b098a2b41f690d380d011a8293;hb=bde9f75de;hp=bf7a2c126019de4a9b7fae7764f1afab8a1bf3b3;hpb=d35f8e72cdcfa7b99e1987bb17b7bc1035ce2213;p=sliver-openvswitch.git diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c index bf7a2c126..fd0829eaa 100644 --- a/utilities/ovs-ofctl.c +++ b/utilities/ovs-ofctl.c @@ -254,7 +254,7 @@ ofctl_exit(struct unixctl_conn *conn, int argc OVS_UNUSED, { bool *exiting = exiting_; *exiting = true; - unixctl_command_reply(conn, 200, ""); + unixctl_command_reply(conn, NULL); } static void run(int retval, const char *message, ...) @@ -910,7 +910,12 @@ ofctl_send(struct unixctl_conn *conn, int argc, ds_put_cstr(&reply, "sent\n"); } } - unixctl_command_reply(conn, ok ? 200 : 501, ds_cstr(&reply)); + + if (ok) { + unixctl_command_reply(conn, ds_cstr(&reply)); + } else { + unixctl_command_reply_error(conn, ds_cstr(&reply)); + } ds_destroy(&reply); } @@ -928,7 +933,7 @@ ofctl_barrier(struct unixctl_conn *conn, int argc OVS_UNUSED, int error; if (aux->conn) { - unixctl_command_reply(conn, 501, "already waiting for barrier reply"); + unixctl_command_reply_error(conn, "already waiting for barrier reply"); return; } @@ -939,7 +944,7 @@ ofctl_barrier(struct unixctl_conn *conn, int argc OVS_UNUSED, error = vconn_send_block(aux->vconn, msg); if (error) { ofpbuf_delete(msg); - unixctl_command_reply(conn, 501, strerror(error)); + unixctl_command_reply_error(conn, strerror(error)); } else { aux->conn = conn; } @@ -953,14 +958,14 @@ ofctl_set_output_file(struct unixctl_conn *conn, int argc OVS_UNUSED, fd = open(argv[1], O_CREAT | O_TRUNC | O_WRONLY, 0666); if (fd < 0) { - unixctl_command_reply(conn, 501, strerror(errno)); + unixctl_command_reply_error(conn, strerror(errno)); return; } fflush(stderr); dup2(fd, STDERR_FILENO); close(fd); - unixctl_command_reply(conn, 200, ""); + unixctl_command_reply(conn, NULL); } static void @@ -1013,7 +1018,7 @@ monitor_vconn(struct vconn *vconn) ofpbuf_delete(b); if (barrier_aux.conn && msg_type == OFPT_BARRIER_REPLY) { - unixctl_command_reply(barrier_aux.conn, 200, ""); + unixctl_command_reply(barrier_aux.conn, NULL); barrier_aux.conn = NULL; } }