nat: nat44-ed i2o & o2i trace fix 64/32064/2
authorFilip Varga <fivarga@cisco.com>
Tue, 20 Apr 2021 14:39:07 +0000 (16:39 +0200)
committerOle Tr�an <otroan@employees.org>
Tue, 20 Apr 2021 16:01:48 +0000 (16:01 +0000)
If cache used than we don't print in trace session index.

Type: fix

Change-Id: Ib965cd8632b5217f8b2dd8b6cc6af3286c747582
Signed-off-by: Filip Varga <fivarga@cisco.com>
src/plugins/nat/nat44-ed/nat44_ed_in2out.c
src/plugins/nat/nat44-ed/nat44_ed_out2in.c

index 6658e5b..fe5fbac 100644 (file)
@@ -69,12 +69,13 @@ format_nat_in2out_ed_trace (u8 * s, va_list * args)
     t->is_slow_path ? "NAT44_IN2OUT_ED_SLOW_PATH" :
     "NAT44_IN2OUT_ED_FAST_PATH";
 
-  s = format (s, "%s: sw_if_index %d, next index %d, session %d", tag,
-             t->sw_if_index, t->next_index, t->session_index);
+  s = format (s, "%s: sw_if_index %d, next index %d", tag, t->sw_if_index,
+             t->next_index);
   if (~0 != t->session_index)
     {
-      s = format (s, ", translation result '%U' via %s",
-                 format_nat_ed_translation_error, t->translation_error,
+      s = format (s, ", session %d, translation result '%U' via %s",
+                 t->session_index, format_nat_ed_translation_error,
+                 t->translation_error,
                  t->translation_via_i2of ? "i2of" : "o2if");
       s = format (s, "\n  i2of %U", format_nat_6t_flow, &t->i2of);
       s = format (s, "\n  o2if %U", format_nat_6t_flow, &t->o2if);
index 2f83ad3..f46433c 100644 (file)
@@ -63,12 +63,13 @@ format_nat44_ed_out2in_trace (u8 * s, va_list * args)
     t->is_slow_path ? "NAT44_OUT2IN_ED_SLOW_PATH" :
     "NAT44_OUT2IN_ED_FAST_PATH";
 
-  s = format (s, "%s: sw_if_index %d, next index %d, session %d", tag,
-             t->sw_if_index, t->next_index, t->session_index);
+  s = format (s, "%s: sw_if_index %d, next index %d", tag, t->sw_if_index,
+             t->next_index);
   if (~0 != t->session_index)
     {
-      s = format (s, ", translation result '%U' via %s",
-                 format_nat_ed_translation_error, t->translation_error,
+      s = format (s, ", session %d, translation result '%U' via %s",
+                 t->session_index, format_nat_ed_translation_error,
+                 t->translation_error,
                  t->translation_via_i2of ? "i2of" : "o2if");
       s = format (s, "\n  i2of %U", format_nat_6t_flow, &t->i2of);
       s = format (s, "\n  o2if %U", format_nat_6t_flow, &t->o2if);