A log message like this one:

2024-01-09T06:45:17.201Z|00071|bfd(handler2)|INFO|ovn-0af536-0: BFD state
change: down->up "Neighbor Signaled Session Down"->"Neighbor Signaled Session
Down".

can be hard to read since '->' usually represents a status change, but
in this case the diagnostic code stays constant. Update the log message to
avoid such ambiguity. The log message for the above event become:

2024-01-09T06:45:16.211Z|00026|bfd(handler3)|INFO|ovn-0af536-0: BFD state
change: up->down, previous failure: "Neighbor Signaled Session Down",
current failure: "Neighbor Signaled Session Down".

Reported-by: Alex Stupnikov <[email protected]>
Reported-at: https://bugzilla.redhat.com/2258496
Signed-off-by: Timothy Redaelli <[email protected]>
---
 lib/bfd.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/bfd.c b/lib/bfd.c
index 9698576d0..8033c5117 100644
--- a/lib/bfd.c
+++ b/lib/bfd.c
@@ -1131,8 +1131,9 @@ bfd_set_state(struct bfd *bfd, enum state state, enum 
diag diag)
         if (!VLOG_DROP_INFO(&rl)) {
             struct ds ds = DS_EMPTY_INITIALIZER;
 
-            ds_put_format(&ds, "%s: BFD state change: %s->%s"
-                          " \"%s\"->\"%s\".\n",
+            ds_put_format(&ds, "%s: BFD state change: %s->%s,"
+                          " previous failure \"%s\", current failure"
+                          " \"%s\".\n",
                           bfd->name, bfd_state_str(bfd->state),
                           bfd_state_str(state), bfd_diag_str(bfd->diag),
                           bfd_diag_str(diag));
-- 
2.43.0

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to