]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Default rounting table for 'show route export/preexport/protocol' is the one related...
authorOndrej Filip <feela@network.cz>
Mon, 25 Feb 2013 09:39:46 +0000 (10:39 +0100)
committerOndrej Filip <feela@network.cz>
Mon, 25 Feb 2013 09:39:46 +0000 (10:39 +0100)
doc/bird.sgml
nest/config.Y
nest/rt-table.c

index 893d3bfaba03feabe044134462cec12747770758..e83cf0e1f2f379bd2277fb2e54bbcdc7a168d2e8 100644 (file)
@@ -670,7 +670,8 @@ This argument can be omitted if there exists only a single instance.
        Show the list of symbols defined in the configuration (names of protocols, routing tables etc.).
 
        <tag>show route [[for] <m/prefix/|<m/IP/] [table <m/sym/] [filter <m/f/|where <m/c/] [(export|preexport) <m/p/] [protocol <m/p/] [<m/options/]</tag>
-       Show contents of a routing table (by default of the main one),
+       Show contents of a routing table (by default of the main one or
+        the table attached to a respective protocol),
        that is routes, their metrics and (in case the <cf/all/ switch is given)
        all their attributes.
 
index 07e1af313514c5d3db3d2a21e3afc83bfca7ab1b..183059e85dee48a3e13aa25dee50fa03b579639f 100644 (file)
@@ -427,7 +427,6 @@ r_args:
      $$ = cfg_allocz(sizeof(struct rt_show_data));
      $$->pxlen = 256;
      $$->filter = FILTER_ACCEPT;
-     $$->table = config->master_rtc->table;
    }
  | r_args prefix {
      $$ = $1;
index 75bfa6ba96c143f89f1dc8429f4de70adcbb9edc..e3fd985ce141bebe5f22914e28201a4552046463 100644 (file)
@@ -2204,6 +2204,11 @@ rt_show(struct rt_show_data *d)
 {
   net *n;
 
+  /* Default is either a master table or a table related to a respective protocol */
+  if ((!d->table) && d->export_protocol) d->table = d->export_protocol->table;
+  if ((!d->table) && d->show_protocol) d->table = d->show_protocol->table;
+  if (!d->table) d->table = config->master_rtc->table;
+
   if (d->pxlen == 256)
     {
       FIB_ITERATE_INIT(&d->fit, &d->table->fib);