zebra: When handling unprocessed messages from kernel print usable string

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>
This commit is contained in:
Donald Sharp 2022-03-24 18:31:23 -04:00
parent 113f966512
commit 0081ab91e6

View File

@ -159,6 +159,9 @@ const struct message rtm_type_str[] = {{RTM_ADD, "RTM_ADD"},
#ifdef RTM_IFANNOUNCE #ifdef RTM_IFANNOUNCE
{RTM_IFANNOUNCE, "RTM_IFANNOUNCE"}, {RTM_IFANNOUNCE, "RTM_IFANNOUNCE"},
#endif /* RTM_IFANNOUNCE */ #endif /* RTM_IFANNOUNCE */
#ifdef RTM_IEEE80211
{RTM_IEEE80211, "RTM_IEEE80211"},
#endif
{0}}; {0}};
static const struct message rtm_flag_str[] = {{RTF_UP, "UP"}, static const struct message rtm_flag_str[] = {{RTF_UP, "UP"},
@ -1405,7 +1408,10 @@ static void kernel_read(struct thread *thread)
#endif /* RTM_IFANNOUNCE */ #endif /* RTM_IFANNOUNCE */
default: default:
if (IS_ZEBRA_DEBUG_KERNEL) 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; break;
} }
} }