summaryrefslogtreecommitdiffstats
path: root/zebra/rt_netlink.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-04-09 20:09:35 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2018-04-09 20:09:35 +0200
commit45df4e9667406c14d12afe353a176de8ee9014f7 (patch)
tree5281b18dd4b38051b9c7287e96c2624ee96a9a51 /zebra/rt_netlink.c
parentMerge pull request #2037 from coreswitch/master (diff)
downloadfrr-45df4e9667406c14d12afe353a176de8ee9014f7.tar.xz
frr-45df4e9667406c14d12afe353a176de8ee9014f7.zip
zebra: Cleanup debugs and add a bit more info
This commit does 2 things: 1) When receiving a route from the kernel, display the incoming table as part of the debug, to facilatate knowing what we are talking about as part of the debug. 2) When displaying nexthop information for routes we were sending to the kernel, no need to display the route information every time Display the route then the individual nexthops for what we are doing. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to '')
-rw-r--r--zebra/rt_netlink.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index 3053c56d1..85e0963b2 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -397,14 +397,14 @@ static int netlink_route_change_read_unicast(struct sockaddr_nl *snl,
if (IS_ZEBRA_DEBUG_KERNEL) {
char buf[PREFIX_STRLEN];
char buf2[PREFIX_STRLEN];
- zlog_debug("%s %s%s%s vrf %u metric: %d Admin Distance: %d",
+ zlog_debug("%s %s%s%s vrf %u(%u) metric: %d Admin Distance: %d",
nl_msg_type_to_str(h->nlmsg_type),
prefix2str(&p, buf, sizeof(buf)),
src_p.prefixlen ? " from " : "",
src_p.prefixlen
? prefix2str(&src_p, buf2, sizeof(buf2))
: "",
- vrf_id, metric, distance);
+ vrf_id, table, metric, distance);
}
afi_t afi = AFI_IP;
@@ -1253,23 +1253,21 @@ _netlink_mpls_build_multipath(const char *routedesc, zebra_nhlfe_t *nhlfe,
*
* @param cmd: Netlink command which is to be processed
* @param p: Prefix for which the change is due
- * @param nexthop: Nexthop which is currently processed
- * @param routedesc: Semantic annotation for nexthop
- * (recursive, multipath, etc.)
* @param family: Address family which the change concerns
+ * @param zvrf: The vrf we are in
+ * @param tableid: The table we are working on
*/
static void _netlink_route_debug(int cmd, struct prefix *p,
- struct nexthop *nexthop, const char *routedesc,
int family, struct zebra_vrf *zvrf,
uint32_t tableid)
{
if (IS_ZEBRA_DEBUG_KERNEL) {
char buf[PREFIX_STRLEN];
zlog_debug(
- "netlink_route_multipath() (%s): %s %s vrf %u(%u) type %s",
- routedesc, nl_msg_type_to_str(cmd),
- prefix2str(p, buf, sizeof(buf)), zvrf_id(zvrf), tableid,
- (nexthop) ? nexthop_type_to_str(nexthop->type) : "UNK");
+ "netlink_route_multipath(): %s %s vrf %u(%u)",
+ nl_msg_type_to_str(cmd),
+ prefix2str(p, buf, sizeof(buf)),
+ zvrf_id(zvrf), tableid);
}
}
@@ -1380,6 +1378,8 @@ static int netlink_route_multipath(int cmd, struct prefix *p,
addattr32(&req.n, sizeof req, RTA_TABLE, re->table);
}
+ _netlink_route_debug(cmd, p, family, zvrf, re->table);
+
if (discard)
goto skip;
@@ -1486,8 +1486,6 @@ static int netlink_route_multipath(int cmd, struct prefix *p,
? "recursive, single-path"
: "single-path";
- _netlink_route_debug(cmd, p, nexthop, routedesc,
- family, zvrf, re->table);
_netlink_route_build_singlepath(
routedesc, bytelen, nexthop, &req.n,
&req.r, sizeof req, cmd);
@@ -1570,8 +1568,6 @@ static int netlink_route_multipath(int cmd, struct prefix *p,
: "multipath";
nexthop_num++;
- _netlink_route_debug(cmd, p, nexthop, routedesc,
- family, zvrf, re->table);
_netlink_route_build_multipath(
routedesc, bytelen, nexthop, rta, rtnh,
&req.r, &src1);