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...@ericsson.com>
Co-authored-by: Csaba Ihllye <csaba.ihl...@ericsson.com>
Signed-off-by: Csaba Ihllye <csaba.ihl...@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");



_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to