summaryrefslogtreecommitdiff
path: root/nest/rt-table.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2014-10-02 12:46:26 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2014-10-02 12:52:50 +0200
commit7aa809016e9a2e24ef914888f7413dc1f2721b17 (patch)
tree57f57e78d86f940fbf78096ffe8bb42a729541c6 /nest/rt-table.c
parent1123e707400984108f48ac7c1be559f7ed8d9306 (diff)
Implements show route noexport option.
Shows routes that would be exported to the protocol but are rejected by the export filter.
Diffstat (limited to 'nest/rt-table.c')
-rw-r--r--nest/rt-table.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/nest/rt-table.c b/nest/rt-table.c
index 37dbb33d..59fd0711 100644
--- a/nest/rt-table.c
+++ b/nest/rt-table.c
@@ -2255,6 +2255,9 @@ rt_show_net(struct cli *c, net *n, struct rt_show_data *d)
if (d->export_mode)
{
+ if (! d->export_protocol->rt_notify)
+ return;
+
a = proto_find_announce_hook(d->export_protocol, d->table);
if (!a)
return;
@@ -2287,18 +2290,20 @@ rt_show_net(struct cli *c, net *n, struct rt_show_data *d)
if (ic < 0)
goto skip;
- if (d->export_mode > 1)
+ if (d->export_mode > RSEM_PREEXPORT)
{
/*
* 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.
*/
+ int do_export = (ic > 0) ||
+ (f_run(a->out_filter, &e, &tmpa, rte_update_pool, FF_FORCE_TMPATTR) <= F_ACCEPT);
- if (!ic && (f_run(a->out_filter, &e, &tmpa, rte_update_pool, FF_FORCE_TMPATTR) > F_ACCEPT))
+ if (do_export != (d->export_mode == RSEM_EXPORT))
goto skip;
- if (ep->accept_ra_types == RA_ACCEPTED)
+ if ((d->export_mode == RSEM_EXPORT) && (ep->accept_ra_types == RA_ACCEPTED))
pass = 1;
}
}