diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2010-02-08 12:42:09 +0100 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2010-02-08 12:42:09 +0100 |
commit | 5a56f27cd00c2cad661aed9b54696699e800883c (patch) | |
tree | caa18423466f93b6bc34df0511f4bd6d2519f04a /nest/rt-table.c | |
parent | aa80826e4af4e6e0a6de5604ab5ce7991f2a8b4e (diff) | |
download | bird-5a56f27cd00c2cad661aed9b54696699e800883c.tar bird-5a56f27cd00c2cad661aed9b54696699e800883c.zip |
Adds asterisk to the primary route in 'show route' cmd.
And also fixes a minor bug.
Diffstat (limited to 'nest/rt-table.c')
-rw-r--r-- | nest/rt-table.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/nest/rt-table.c b/nest/rt-table.c index ed7ecd5..413675c 100644 --- a/nest/rt-table.c +++ b/nest/rt-table.c @@ -1116,6 +1116,7 @@ rt_show_rte(struct cli *c, byte *ia, rte *e, struct rt_show_data *d, ea_list *tm byte via[STD_ADDRESS_P_LENGTH+32], from[STD_ADDRESS_P_LENGTH+6]; byte tm[TM_DATETIME_BUFFER_SIZE], info[256]; rta *a = e->attrs; + int primary = (e->net->routes == e); rt_format_via(e, via); tm_format_datetime(tm, &config->tf_route, e->lastmod); @@ -1136,7 +1137,8 @@ rt_show_rte(struct cli *c, byte *ia, rte *e, struct rt_show_data *d, ea_list *tm a->proto->proto->get_route_info(e, info, tmpa); else bsprintf(info, " (%d)", e->pref); - cli_printf(c, -1007, "%-18s %s [%s %s%s]%s", ia, via, a->proto->name, tm, from, info); + cli_printf(c, -1007, "%-18s %s [%s %s%s]%s%s", ia, via, a->proto->name, + tm, from, primary ? " *" : "", info); if (d->verbose) rta_show(c, a, tmpa); } |