diff options
author | Christian Franke <chris@opensourcerouting.org> | 2012-12-07 16:45:52 +0000 |
---|---|---|
committer | David Lamparter <equinox@opensourcerouting.org> | 2013-01-16 01:45:57 +0100 |
commit | dcab1bb822161d55795aad59b14c5c5d79b71e1f (patch) | |
tree | 0e55397d41d91f613123c6c812bc8691caa02b27 /bgpd/bgp_nexthop.c | |
parent | 86998bc2bc9506841250c8d49dd2df2464660a18 (diff) |
bgpd: conditional default-originate using route-map
Incorporate a patch by Svetozar Mihailov which implements
default-originate route-maps to behave as expected, i.e. allowing
the default route to be advertised conditionally, depending on a
criterion given by the route-map.
I am aware that the performance attributes of the following implementation
are far from optimal. However, this affects only code paths belonging to
a feature that is broken without this patch, therefore, it seems reasonable
to me to have this in the mainline for now.
Cc: Svetozar Mihailov <quagga@j.zarhi.com>
Reported-by: Sébastien Cramatte <scramatte@gmail.com>
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'bgpd/bgp_nexthop.c')
-rw-r--r-- | bgpd/bgp_nexthop.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/bgpd/bgp_nexthop.c b/bgpd/bgp_nexthop.c index 0e56d368..d4692366 100644 --- a/bgpd/bgp_nexthop.c +++ b/bgpd/bgp_nexthop.c @@ -506,6 +506,16 @@ bgp_scan (afi_t afi, safi_t safi) else if (afi == AFI_IP6) zlog_debug ("scanning IPv6 Unicast routing tables"); } + + /* Reevaluate default-originate route-maps and announce/withdraw + * default route if neccesary. */ + for (ALL_LIST_ELEMENTS (bgp->peer, node, nnode, peer)) + { + if (peer->status == Established + && CHECK_FLAG(peer->af_flags[afi][safi], PEER_FLAG_DEFAULT_ORIGINATE) + && peer->default_rmap[afi][safi].name) + bgp_default_originate (peer, afi, safi, 0); + } } /* BGP scan thread. This thread check nexthop reachability. */ |