]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Merge commit 'c865cae3eb327d1e0a745352c483bc7cb00f9323' into integrated
authorOndrej Zajicek <santiago@crfreenet.org>
Fri, 2 May 2014 18:23:38 +0000 (20:23 +0200)
committerOndrej Zajicek <santiago@crfreenet.org>
Fri, 2 May 2014 18:23:38 +0000 (20:23 +0200)
Conflicts:

nest/rt-table.c

1  2 
nest/config.Y
nest/proto.c
nest/protocol.h
nest/rt-table.c

diff --cc nest/config.Y
Simple merge
diff --cc nest/proto.c
Simple merge
diff --cc nest/protocol.h
Simple merge
diff --cc nest/rt-table.c
index 4361778eefee43094e32f2098f4ea20e77a42123,4c889d0d1c033de3c6065880d2c6e33076f1a7ac..74a016ba70a1ab775a7a1cb9309e3d31fcf53f08
@@@ -2326,13 -2245,22 +2326,22 @@@ static voi
  rt_show_net(struct cli *c, net *n, struct rt_show_data *d)
  {
    rte *e, *ee;
-   byte prefix[MAX_ADDRESS_P_LENGTH];
-   struct announce_hook *a;
-   int ok;
 -  byte ia[STD_ADDRESS_P_LENGTH+8];
++  byte prefix[MAX_ADDRESS_P_LENGTH+8];
+   struct ea_list *tmpa;
+   struct announce_hook *a = NULL;
+   int first = 1;
+   int pass = 0;
  
 -  bsprintf(ia, "%I/%d", n->n.prefix, n->n.pxlen);
 +  fn_print(prefix, sizeof(prefix), &n->n);
  
-   for(e=n->routes; e; e=e->next)
+   if (d->export_mode)
+     {
+       a = proto_find_announce_hook(d->export_protocol, d->table);
+       if (!a)
+       return;
+     }
+   for (e = n->routes; e; e = e->next)
      {
        if (rte_is_filtered(e) != d->filtered)
        continue;
        ee = e;
        rte_update_lock();              /* We use the update buffer for filtering */
        tmpa = make_tmp_attrs(e, rte_update_pool);
-       ok = f_run(d->filter, &e, &tmpa, rte_update_pool, FF_FORCE_TMPATTR) <= F_ACCEPT;
-       if (p2 && p2 != src->proto) ok = 0;
-       if (ok && d->export_mode)
+       if (d->export_mode)
        {
-         int ic;
-         if ((ic = p1->import_control ? p1->import_control(p1, &e, &tmpa, rte_update_pool) : 0) < 0)
-           ok = 0;
-         else if (!ic && d->export_mode > 1)
+         struct proto *ep = d->export_protocol;
+         int ic = ep->import_control ? ep->import_control(ep, &e, &tmpa, rte_update_pool) : 0;
+         if (ep->accept_ra_types == RA_OPTIMAL)
+           pass = 1;
+         if (ic < 0)
+           goto skip;
+         if (d->export_mode > 1)
            {
-             /* FIXME - this shows what should be exported according
-                to current filters, but not what was really exported.
-                'configure soft' command may change the export filter
-                and do not update routes */
-             if ((a = proto_find_announce_hook(p1, d->table)) && 
-                 (f_run(a->out_filter, &e, &tmpa, rte_update_pool, FF_FORCE_TMPATTR) > F_ACCEPT))
-               ok = 0;
+             /*
+              * FIXME - This shows what should be exported according to current
+              * filters, but not what was really exported. 'configure soft'
+              * command may change the export filter and do not update routes.
+              */
+             if (!ic && (f_run(a->out_filter, &e, &tmpa, rte_update_pool, FF_FORCE_TMPATTR) > F_ACCEPT))
+               goto skip;
+             if (ep->accept_ra_types == RA_ACCEPTED)
+               pass = 1;
            }
        }
-       if (ok)
-       {
-         d->show_counter++;
-         if (d->stats < 2)
-           rt_show_rte(c, prefix, e, d, tmpa);
-         prefix[0] = '\0';
-       }
+       if (d->show_protocol && (d->show_protocol != e->attrs->src->proto))
+       goto skip;
+       if (f_run(d->filter, &e, &tmpa, rte_update_pool, FF_FORCE_TMPATTR) > F_ACCEPT)
+       goto skip;
+       d->show_counter++;
+       if (d->stats < 2)
 -      rt_show_rte(c, ia, e, d, tmpa);
 -      ia[0] = 0;
++      rt_show_rte(c, prefix, e, d, tmpa);
++      prefix[0] = '\0';
+     skip:
        if (e != ee)
        {
        rte_free(e);