summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/rde_rib.c
AgeCommit message (Collapse)Author
2009-06-29Protect the other rde_send_kroute() with a F_RIB_NOFIB check.Claudio Jeker
2009-06-07First attempt at reload support for RIBs. There is some magic that I doClaudio Jeker
not fully understand but at least no flames are comming out of my test box anymore.
2009-06-04Implement rib_find and add a rib id to struct rde_peer.Claudio Jeker
2009-06-04Add "rde rib <name>" to the config and allow the rde to use these other RIBs.Claudio Jeker
Still a bit hackish, reload is missing and printconf as well. Looks good h@
2009-06-03Allocate all rib contextes for tree walks and don't use static stack memory.Claudio Jeker
This will make interruptable walks a lot easier.
2009-06-03Initial stab at rib_free() until now unused.Claudio Jeker
2009-06-03Better way to allocate new RIBs.Claudio Jeker
2009-06-03Make prefix_destroy more generic and use it in prefix_remove this is possibleClaudio Jeker
because path_remove was changed to remove the prefixes in a slightly different way.
2009-06-02Move the rest of the rib dump functions into rde_rib.c where it belongs.Claudio Jeker
2009-06-01Use only one list to queue the dump contextes on. Use the list in structClaudio Jeker
rib_context instead of the ctl specific rde_dump_ctx to make it more general.
2009-06-01Do not call the upcall twice on some prefixes. Move the upcall back toClaudio Jeker
where it was beforhands.
2009-06-01Holy simplification batman. Use the per rib entry flags to lock entriesClaudio Jeker
when interrupting rib dumps and now we no longer need evil RB magic to find the next entry on restart.
2009-06-01Instead of storing a pointer to the RIB head in the RIB element use thatClaudio Jeker
space for a flags field and the RIB id. In the end bgpd will be able to lock RIB elements and therefore make it possible to interrupt all tree walks.
2009-05-27Move update and withdraw code into own functions to simplify the necessaryClaudio Jeker
changes to make multiple RIB functional. Also change the way we account the prefixes per peer (for maxprefix check). Every prefix that was added to any RIB is counted. OK henning@
2009-05-21Make it possible to turn off the decision process per RIB. This is mainlyClaudio Jeker
used for the Adj-Rib-In. Also initialize the Adj-Rib-In correctly and mark it a noevaluate.
2009-05-17F_LOCAL and F_ORIGINAL are gone. The Adj-Rib-In is now a distinct tree.Claudio Jeker
Fix pf table code by checking if the aspath has a pftableid set or not instead of doing the F_LOCAL dance. This works because the in the Adj-Rib-In it is impossible to set pftableid.
2009-05-17rib_dump_r needs to check the af of the prefix because there is no rib perClaudio Jeker
address family. In rib_restart fix a possible use after free.
2009-05-17Rework most of the RDE to allow multiple RIBs. This is mostly preparationClaudio Jeker
work by changing the way the RDE DB is built. struct prefix and struct pt_entry are simplified and extended with a rib_entry where the decision tree is run on. From now on a prefix can only reside on one particular RIB which simplifies the code a bit. Currently there are two fixed ribs (adj-rib-in and the local-rib) which needs to be made more dynamic in upcomming commits. This is work in progress, the RDE seems to work for me and sthen@ (no flames comming out of our testrouters but there is still a lot missing) Move into the tree to simplify developement -- henning@
2009-04-23Rework the way we handle announced networks. Instead of two freak rde_peersClaudio Jeker
use one that is less freaky. Merge bgpctl and config networks into one tree. First step of a larger change in the RDE and this goes now in to allow to move forward.
2008-11-21Track nexthops when the underlying route is changing. Until now true nexthopsClaudio Jeker
were only resolved when they were added. This calls for troubles if something like ospfd starts to change the underlying routes. Tested by gollo@, OK henning@
2007-06-01Remove a stupid wrapper function that does nothing more then calling anotherClaudio Jeker
function with the same arguments.
2007-05-11Various spelling fixes from Stuart Henderson.Claudio Jeker
2007-04-02Typo.Claudio Jeker
2007-02-22KNFHenning Brauer
2007-01-11Correct logic in path_update() so that moves are only done when needed.Claudio Jeker
Previously prefix changes of neighbors with softreconfig in disabled where using prefix_add() instead of prefix_move(). Luckily prefix_add() has additional logic to detect this case and calls prefix_move() itself. This made backtraces of a totaly different issue so strange that I was hunting a bug for weeks at the completely wrong spot. Doh!
2006-12-12Change nexthop_delete() to be more obvious what's going on. No functionalClaudio Jeker
change. OK henning@
2006-12-12Even IPv6 has a prefixlen limit. This ensures that we do not overflow theClaudio Jeker
struct in6_addr later on. OK henning@
2006-12-12In path_remove() remove only local prefixes from the pftable.Claudio Jeker
OK henning@
2006-06-01Copy the pftableid in path_copy and correctly do the ref/unref dance inClaudio Jeker
path_copy and path_put. Diff from Kevin Brintnall, looks good henning@
2006-05-28Even better nexthop delete behaviour. Do not delete nexthop if they are usedClaudio Jeker
by filter sets or if the nexthop is currently looked up. With this the "nexthop_update: non-existent nexthop" warning should be history. OK henning@
2006-05-28Preload and pin nexthop used in filtersets so the are validiated when used.Claudio Jeker
This will fix problems with set nexthop on outgoing filters. Found by gluk@ OK henning@
2006-04-04add "set nexthop self", force nexthop to be set to own address even with IBGPHenning Brauer
requested & tested Falk Brockerhoff <fb@smartterra.de>, and tony sarendal tested this too. claudio ok
2006-03-15In nexthop_compare() if the two passed pointers point to the same objectClaudio Jeker
the odds are better than good that there is no difference.
2006-01-24Finally start using the Adj-RIB-In. The most complex part is the modificationClaudio Jeker
of path_update(). There are about 10 different ways how to update a path and some of them are tricky. Looks good henning@
2006-01-24It is possible that a prefix is part of two RIBs in that case prefix_remove()Claudio Jeker
needs to be extra careful and only remove the prefix from the specified RIB. Looks good henning@
2006-01-24KNFHenning Brauer
2006-01-20Proactively fix prefix counters. Currently only F_LOCAL prefixes exist butClaudio Jeker
as soon as F_ORIGINAL come the counters would no longer be correct and in the end max-prefix would no longer work. Add additinal counters for F_ORIGINAL prefixes and bump the correct conter depending on the prefix flags. OK henning@
2006-01-20Pass flags to prefix_move() so that a prefix that has both F_ORIGINAL andClaudio Jeker
F_LOCAL set can be moved correctly. This is more like a add as we have one prefix more afterwards. Looks good henning@
2006-01-14Small step in supporting the Adj-RIB-In additionaly to the Local-RIB.Claudio Jeker
First step is to define two flags F_LOCAL and F_ORIGINAL. These flags are used to distinguish prefix in the Local-RIB and those in the Adj- RIB-In. Adapt prefix API and add additional checks so that no Adj-RIB- In prefixes get mistakenly selected. Currently no F_ORIGINAL prefixes are created but this may change soon. Looks good Henning.
2006-01-12Copy AS path in rde_filter() on demand instead of doing it before callingClaudio Jeker
rde_filter(). Adapt path_update() to this change too. path_update() does a path_copy before linking the rde_aspath into the RIB. Looks good Henning.
2006-01-09Ups. Inverse logic.Claudio Jeker
2006-01-05Kill ENSURE(), remove ensure.h, say bye bye to fatal_ensure() andClaudio Jeker
one hip hip hooray from Henning.
2006-01-05Cache optional BGP attributes (mostly communities) and use a simpleClaudio Jeker
pointer plus a ref counter to link the attributes to the path object. Saves +/- 10M on 11 full feeds. Looks good Henning
2006-01-04Fix a mem leak of the unusual kind. In some cases a new aspath was addedClaudio Jeker
to the RIB without checking if there was a equal path already available. Modify path_update() so that we do not link a new aspath without calling path_lookup() before to check if the aspath is not already in the RIB. Found via bgpctl show rib mem. OK henning
2006-01-03Track some (memory) statistics in the RDE. Accessible via bgpctl.Claudio Jeker
2005-12-30Use sys/hash.h instead of own built functions that work similar.Claudio Jeker
While there reorder some structs to help with alignment.
2005-11-29Add a flags field to struct prefix which will be used shortly. Remove the peerClaudio Jeker
pointer so that the size does not grow. Adding 4 bytes to struct prefix would result in 64MB more memory usage on one of my systems.
2005-07-29Add another piece to the IPv6 puzzle. This time code to generate MP updates.Claudio Jeker
Does not affect IPv4 minimaly tested for IPv6 because we still don't have an IPv6 capable neighbor. henning@ ya
2005-07-01Make the pftable filter set use the name2id "cache" like the route labels.Claudio Jeker
This saves 14 bytes per aspath. OK henning@
2005-06-29rtlabel support via filter sets. Just use "set rtlabel foobar" in filtersClaudio Jeker
network and neighbor statements and the routes are labeled accordingly. While doing that fix some mem-leaks by introducing filterset_free() and remove the free on send option of send_filterset(). This took a bit longer because we need to carefully track the rtlabel id refcnts or bad things may happen on reloads. henning@ looks fine