]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Nest: Fix primary flag in show route
authorOndrej Zajicek (work) <santiago@crfreenet.org>
Fri, 25 Oct 2019 11:28:51 +0000 (13:28 +0200)
committerOndrej Zajicek (work) <santiago@crfreenet.org>
Fri, 25 Oct 2019 11:28:51 +0000 (13:28 +0200)
The route is changed by rte_make_tmp_attrs(), so we need to compare
net->routes to the original one.

Thanks to Kenth Eriksson for the bugreport.

nest/rt-show.c

index 002a6039c961d23b233d37aac66b135136966b4a..5114e5f0c13f9b7b663d7dade2c575971f470230 100644 (file)
@@ -29,12 +29,11 @@ rt_show_table(struct cli *c, struct rt_show_data *d)
 }
 
 static void
 }
 
 static void
-rt_show_rte(struct cli *c, byte *ia, rte *e, struct rt_show_data *d)
+rt_show_rte(struct cli *c, byte *ia, rte *e, struct rt_show_data *d, int primary)
 {
   byte from[IPA_MAX_TEXT_LENGTH+8];
   byte tm[TM_DATETIME_BUFFER_SIZE], info[256];
   rta *a = e->attrs;
 {
   byte from[IPA_MAX_TEXT_LENGTH+8];
   byte tm[TM_DATETIME_BUFFER_SIZE], info[256];
   rta *a = e->attrs;
-  int primary = (e->net->routes == e);
   int sync_error = (e->net->n.flags & KRF_SYNC_ERROR);
   void (*get_route_info)(struct rte *, byte *buf);
   struct nexthop *nh;
   int sync_error = (e->net->n.flags & KRF_SYNC_ERROR);
   void (*get_route_info)(struct rte *, byte *buf);
   struct nexthop *nh;
@@ -167,7 +166,7 @@ rt_show_net(struct cli *c, net *n, struct rt_show_data *d)
        goto skip;
 
       if (d->stats < 2)
        goto skip;
 
       if (d->stats < 2)
-       rt_show_rte(c, ia, e, d);
+       rt_show_rte(c, ia, e, d, (e->net->routes == ee));
 
       d->show_counter++;
       ia[0] = 0;
 
       d->show_counter++;
       ia[0] = 0;