[ovs-dev] Fwd: [PATCH] bfd: Fix signs in ovs-appctl bfd/show Detect Time, Next Tx Time, Last TX Time

Gabor Szucs gabor.sz.cs at ericsson.com
Thu May 18 13:39:19 UTC 2017


Hi,
This is a fix for ovs-appctl bfd/show printout that looks partly incorrect.

ovs-appctl bfd/show command printout
shows negative time lag from now for upcoming events:
         Detect Time: now -2632ms
         Next TX Time: now -800ms
and positive time lag from now for past event:
         Last TX Time: now +150ms

The fix negates the signs.

Signed-off-by: Gábor Szűcs <gabor.sz.cs at ericsson.com>
Co-authored-by: Csaba Ihllye <csaba.ihllye at ericsson.com>
Signed-off-by: Csaba Ihllye <csaba.ihllye at ericsson.com>
---
diff --git a/lib/bfd.c b/lib/bfd.c
index 1fb1cfb..9e79f12 100644
--- a/lib/bfd.c
+++ b/lib/bfd.c
@@ -1239,11 +1239,11 @@ bfd_put_details(struct ds *ds, const struct bfd *bfd) OVS_REQUIRES(mutex)
      ds_put_format(ds, "\tTX Interval: Approx %lldms\n", bfd_tx_interval(bfd));
      ds_put_format(ds, "\tRX Interval: Approx %lldms\n", bfd_rx_interval(bfd));
      ds_put_format(ds, "\tDetect Time: now %+lldms\n",
-                  time_msec() - bfd->detect_time);
+                  bfd->detect_time - time_msec());
      ds_put_format(ds, "\tNext TX Time: now %+lldms\n",
-                  time_msec() - bfd->next_tx);
+                  bfd->next_tx - time_msec());
      ds_put_format(ds, "\tLast TX Time: now %+lldms\n",
-                  time_msec() - bfd->last_tx);
+                  bfd->last_tx - time_msec());

      ds_put_cstr(ds, "\n");





More information about the dev mailing list