bird: show route behaviour

Ondrej Filip feela at network.cz
Sun Feb 24 18:52:52 CET 2013


On 24.2.2013 17:28, Hans van Kranenburg wrote:
> On 02/24/2013 05:12 PM, Ondrej Filip wrote:
>> On 24.2.2013 01:08, Dan Rimal wrote:

Hans and Dan,

>>
>>> Weird show behaviour comes now:
>>>
>>> bird> show route export nix1_nix
>>> 4.4.4.0/24         via 172.17.1.1 on eth0 [s_master 00:29] * (200)
>>> 5.5.5.0/24         via 172.17.1.1 on eth0 [s_nix 00:29] * (200)
>>> 6.6.6.0/24         via 172.17.1.1 on eth0 [s_tranzit 00:29] * (200)
>>
>> I believe 'show route export nix1_nix table t_nix' does the right
>> thing. Can you test it please?
> 
> In my case similar case, the equivalent command of this does show the
> right output indeed.
> 
>> I think I understand the issue, I will look at it.
> 
> Adding 'table master' instead of the table name that was chosen in the
> protocol declaration shows the same as the default output when not
> adding the table name.
> 

yes, because 'table master' is default. I produced a simple patch
(attached) against the current git repository, but it should work
against 1.3.9.  However I am not 100% sure whether to submit this into
the main branch or rather just document that 'table master' is
default. I will discuss it with my teammates. And of course, your
comments are welcome.

			Ondrej


-------------- next part --------------
diff --git a/nest/config.Y b/nest/config.Y
index 07e1af3..c22b5ab 100644
--- a/nest/config.Y
+++ b/nest/config.Y
@@ -427,7 +427,7 @@ r_args:
      $$ = cfg_allocz(sizeof(struct rt_show_data));
      $$->pxlen = 256;
      $$->filter = FILTER_ACCEPT;
-     $$->table = config->master_rtc->table;
+     //$$->table = config->master_rtc->table;
    }
  | r_args prefix {
      $$ = $1;
diff --git a/nest/rt-table.c b/nest/rt-table.c
index 75bfa6b..d0bbefc 100644
--- a/nest/rt-table.c
+++ b/nest/rt-table.c
@@ -2204,6 +2204,10 @@ rt_show(struct rt_show_data *d)
 {
   net *n;
 
+  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);


More information about the Bird-users mailing list