X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=ovsdb%2Fovsdb-server.c;h=8d44d84857ca866ec8a736b6d0e956dd99ea338a;hb=356180a825c94314f3d1667003e64526d1b69da5;hp=9eb58ebf1fd758826fc98a67156912681a88e5cb;hpb=a4613b01abefdadf53dbf03025748fae3230eb68;p=openvswitch diff --git a/ovsdb/ovsdb-server.c b/ovsdb/ovsdb-server.c index 9eb58ebf..8d44d848 100644 --- a/ovsdb/ovsdb-server.c +++ b/ovsdb/ovsdb-server.c @@ -469,7 +469,7 @@ update_remote_row(const struct ovsdb_row *row, struct ovsdb_txn *txn, struct ovsdb_row *rw_row; const char *target; const struct ovsdb_jsonrpc_remote_status *status; - char *keys[3], *values[3]; + char *keys[4], *values[4]; size_t n = 0; /* Get the "target" (protocol/host/port) spec. */ @@ -495,9 +495,14 @@ update_remote_row(const struct ovsdb_row *row, struct ovsdb_txn *txn, keys[n] = xstrdup("state"); values[n++] = xstrdup(status->state); - keys[n] = xstrdup(status->is_connected ? "time_connected" - : "time_disconnected"); - values[n++] = xasprintf("%u", status->conn_secs); + if (status->sec_since_connect != UINT_MAX) { + keys[n] = xstrdup("sec_since_connect"); + values[n++] = xasprintf("%u", status->sec_since_connect); + } + if (status->sec_since_disconnect != UINT_MAX) { + keys[n] = xstrdup("sec_since_disconnect"); + values[n++] = xasprintf("%u", status->sec_since_disconnect); + } if (status->last_error) { keys[n] = xstrdup("last_error"); values[n++] =