]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Adds asterisk to the primary route in 'show route' cmd.
authorOndrej Zajicek <santiago@crfreenet.org>
Mon, 8 Feb 2010 11:42:09 +0000 (12:42 +0100)
committerOndrej Zajicek <santiago@crfreenet.org>
Mon, 8 Feb 2010 11:42:09 +0000 (12:42 +0100)
And also fixes a minor bug.

nest/proto.c
nest/rt-table.c

index e19c3948a54908ab5de0807736d529ac2312a0ec..870edddd8a7f61ff3a2f63391e1f35fb0b70873a 100644 (file)
@@ -311,6 +311,7 @@ proto_reconfigure(struct proto *p, struct proto_config *oc, struct proto_config
   p->name = nc->name;
   p->in_filter = nc->in_filter;
   p->out_filter = nc->out_filter;
+  p->preference = nc->preference;
 
   if (import_changed || export_changed)
     log(L_INFO "Reloading protocol %s", p->name);
index ed7ecd57f7af521f7983f686bb0d8332b0c61b92..413675c9c17e94642ad0fcad627fa3029201ff24 100644 (file)
@@ -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);
 }