summaryrefslogtreecommitdiff
path: root/nest
diff options
context:
space:
mode:
authorOndrej Filip <feela@network.cz>2013-02-25 10:39:46 +0100
committerOndrej Filip <feela@network.cz>2013-02-25 10:39:46 +0100
commite667622a35722ec007137e678f4f70841562e57f (patch)
tree90c0e478d352f4e022ad5932893374a94c83660c /nest
parenta9c38203bdcad92f7ac0a8a912241d2acb483f2c (diff)
Default rounting table for 'show route export/preexport/protocol' is the one related to a respective protocol.
Diffstat (limited to 'nest')
-rw-r--r--nest/config.Y1
-rw-r--r--nest/rt-table.c5
2 files changed, 5 insertions, 1 deletions
diff --git a/nest/config.Y b/nest/config.Y
index 07e1af31..183059e8 100644
--- a/nest/config.Y
+++ b/nest/config.Y
@@ -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;
diff --git a/nest/rt-table.c b/nest/rt-table.c
index 75bfa6ba..e3fd985c 100644
--- a/nest/rt-table.c
+++ b/nest/rt-table.c
@@ -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);