Commit ffc18166 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Print next hops in route dumps.

parent d4627c06
...@@ -698,8 +698,11 @@ dump_tables(FILE *out) ...@@ -698,8 +698,11 @@ dump_tables(FILE *out)
int id = int id =
routes[i].src->plen != 128 || routes[i].src->plen != 128 ||
memcmp(routes[i].src->prefix, routes[i].src->address, 16) != 0; memcmp(routes[i].src->prefix, routes[i].src->address, 16) != 0;
const unsigned char *nexthop =
memcmp(routes[i].nexthop, routes[i].neigh->address, 16) == 0 ?
NULL : routes[i].nexthop;
fprintf(out, "%s metric %d refmetric %d %s%s seqno %d age %d " fprintf(out, "%s metric %d refmetric %d %s%s seqno %d age %d "
"via %s nexthop %s%s\n", "via %s neigh %s%s%s%s\n",
format_prefix(routes[i].src->prefix, routes[i].src->plen), format_prefix(routes[i].src->prefix, routes[i].src->plen),
routes[i].metric, routes[i].refmetric, routes[i].metric, routes[i].refmetric,
id ? "id " : "", id ? "id " : "",
...@@ -708,6 +711,8 @@ dump_tables(FILE *out) ...@@ -708,6 +711,8 @@ dump_tables(FILE *out)
(int)(now.tv_sec - routes[i].time), (int)(now.tv_sec - routes[i].time),
routes[i].neigh->network->ifname, routes[i].neigh->network->ifname,
format_address(routes[i].neigh->address), format_address(routes[i].neigh->address),
nexthop ? " nexthop " : "",
nexthop ? format_address(nexthop) : "",
routes[i].installed ? " (installed)" : routes[i].installed ? " (installed)" :
route_feasible(&routes[i]) ? " (feasible)" : ""); route_feasible(&routes[i]) ? " (feasible)" : "");
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment