]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: When handling unprocessed messages from kernel print usable string
authorDonald Sharp <sharpd@nvidia.com>
Thu, 24 Mar 2022 22:31:23 +0000 (18:31 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Fri, 25 Mar 2022 00:07:00 +0000 (20:07 -0400)
Add new debug output to show the string of the message type that
is currently unhandled:

2022-03-24 18:30:15.284 [DEBG] zebra: [V3NSB-BPKBD] Kernel:
2022-03-24 18:30:15.284 [DEBG] zebra: [HDTM1-ENZNM] Kernel: message seq 792
2022-03-24 18:30:15.284 [DEBG] zebra: [MJD4M-0AAAR] Kernel: pid 594488, rtm_addrs {DST,GENMASK}
2022-03-24 18:30:15.285 [DEBG] zebra: [GRDRZ-0N92S] Unprocessed RTM_type: RTM_NEWMADDR(d)

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
zebra/kernel_socket.c

index 6583af0a54d55482a0771b678980fa0afe15635c..420e41e39495a1c1f41b7f5c9fdeb94ea11bf17a 100644 (file)
@@ -159,6 +159,9 @@ const struct message rtm_type_str[] = {{RTM_ADD, "RTM_ADD"},
 #ifdef RTM_IFANNOUNCE
                                       {RTM_IFANNOUNCE, "RTM_IFANNOUNCE"},
 #endif /* RTM_IFANNOUNCE */
+#ifdef RTM_IEEE80211
+                                      {RTM_IEEE80211, "RTM_IEEE80211"},
+#endif
                                       {0}};
 
 static const struct message rtm_flag_str[] = {{RTF_UP, "UP"},
@@ -1405,7 +1408,10 @@ static void kernel_read(struct thread *thread)
 #endif /* RTM_IFANNOUNCE */
        default:
                if (IS_ZEBRA_DEBUG_KERNEL)
-                       zlog_debug("Unprocessed RTM_type: %d", rtm->rtm_type);
+                       zlog_debug(
+                               "Unprocessed RTM_type: %s(%d)",
+                               lookup_msg(rtm_type_str, rtm->rtm_type, NULL),
+                               rtm->rtm_type);
                break;
        }
 }