From 8c8f250b0a87621d1a21b123027c11dd2e961953 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Tue, 18 Jun 2019 08:47:28 -0400 Subject: [PATCH] zebra: Increase debugs to understand why we rejected a kernel route Add a bit of extra code to indicate to the operator why we intentionally rejected a kernel route from being used. Signed-off-by: Donald Sharp --- zebra/kernel_netlink.c | 12 +++++++++++- zebra/rt_netlink.c | 4 ++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/zebra/kernel_netlink.c b/zebra/kernel_netlink.c index 387a3531bd..c044226e84 100644 --- a/zebra/kernel_netlink.c +++ b/zebra/kernel_netlink.c @@ -128,8 +128,18 @@ static const struct message family_str[] = {{AF_INET, "ipv4"}, {RTNL_FAMILY_IP6MR, "ipv6MR"}, {0}}; -static const struct message rttype_str[] = {{RTN_UNICAST, "unicast"}, +static const struct message rttype_str[] = {{RTN_UNSPEC, "none"}, + {RTN_UNICAST, "unicast"}, + {RTN_LOCAL, "local"}, + {RTN_BROADCAST, "broadcast"}, + {RTN_ANYCAST, "anycast"}, {RTN_MULTICAST, "multicast"}, + {RTN_BLACKHOLE, "blackhole"}, + {RTN_UNREACHABLE, "unreachable"}, + {RTN_PROHIBIT, "prohibited"}, + {RTN_THROW, "throw"}, + {RTN_NAT, "nat"}, + {RTN_XRESOLVE, "resolver"}, {0}}; extern struct thread_master *master; diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index 92c78a4cbb..3c1bc4d081 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -330,6 +330,10 @@ static int netlink_route_change_read_unicast(struct nlmsghdr *h, ns_id_t ns_id, bh_type = BLACKHOLE_ADMINPROHIB; break; default: + if (IS_ZEBRA_DEBUG_KERNEL) + zlog_debug("Route rtm_type: %s(%d) intentionally ignoring", + nl_rttype_to_str(rtm->rtm_type), + rtm->rtm_type); return 0; }