summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd
AgeCommit message (Collapse)Author
2018-11-18Use correct name when printing the error message that a network prefix-setClaudio Jeker
is not found. Fixes crash reported by Tom Smyth.
2018-11-14Plug memory leak in host()'s error code pathRicardo Mestre
OK claudio@
2018-11-14Remove an unneeded union wrapping the skipsteps pointer.Claudio Jeker
OK phessler@
2018-11-14Adjust comment.Claudio Jeker
2018-11-10fix error message when querying a non-existent tabledenis
OK claudio@
2018-11-08Introduce rde_update_queue_pending() similar to rib_dump_pending() it checksClaudio Jeker
if there are any neighbors that have pending updates. If so the timeout of the poll loop is set to 0 so that the work is completet ASAP. The regress test was not working because of this. The RDE was stuck in poll() instead of sending the updates out. Tested and OK denis@
2018-11-08Committed wrong version. Check the flags against the fib flags from theClaudio Jeker
config and not the old flags. Needed so that changing flags and rtableid at the same time works.
2018-11-08Only whack the RIB and recreate it if the the FIB distribution flags changedClaudio Jeker
or the rtableid changed and there is a FIB. In the NOFIB case changing the rtableid has no effect. Fixes a problem introduced with keeping the default ribs alive and Adj-RIB-In/Out. Probelm found, tested and OK denis@
2018-11-05F_RIB_HASNOFIB is defined, let's use itdenis
OK claudio@
2018-11-04Graceful BGP Session Shutdown is a real RFC, add it to the list.Claudio Jeker
OK job@, benno@
2018-11-04Introduce a real Adj-RIB-Out. At the same time remove the update_ribClaudio Jeker
introduced before 6.4 because it now can be replaced with the real RIB. Main changes are: - simplified 'show rib' handling since everything is now a real RIB - path_update() is now returning if a prefix was not modified, added or moved - softreconfig out case is simpler since path_update does all the magic now - Adjust shutdown code to work with the Adj-RIB-Out Tested and OK denis@, benno@
2018-11-01- odd condition/test in PF lexerAlexandr Nedvedicky
(and other lexers too) This commit rectifies earlier change: in the lex... even inside quotes, a \ followed by space or tab should expand to space or tab, and a \ followed by newline should be ignored (as a line continuation). compatible with the needs of hoststated (which has the most strict quoted string requirements), and ifstated (where one commonly does line continuations in strings). OK deraadt@, OK millert@
2018-10-31Remove tail queues which link peer, aspath and prefix together. TheseClaudio Jeker
lists are no longer needed and make it possible to share rde_aspath between peers & prefixes. Instead of the lists the rde_aspath is now reference counted. With this struct prefix is now the central place where everything is connected to making the RIB a bit easier to handle. With input and OK denis@
2018-10-31Never remove the default RIBs from the RDE.Claudio Jeker
OK denis@
2018-10-29Replace some walkers using the aspath/prefix lists with a rib_dump walker.Claudio Jeker
network_flush() is now using rib_dump_new to walk the Adj-RIB-In and remove all dynamically added announcements. peer_flush() got generalized and is now used also in peer_down(). It also uses a walker to remove all prefixes of a peer but does it in a synchronous way for now. OK benno@
2018-10-29Fix route-collector mode by allowing the RDE to disable the decision processClaudio Jeker
on reload but after that not allowing it to be re-enabled. So now it is possible to enable route-collector mode again but it is still not possible to turn it of via reload. Problem reported by Aaron A. Glenn. OK benno@
2018-10-26Track the amount of memory used for sets and tries (aka anything-set)Claudio Jeker
OK deraadt@
2018-10-26Use proper type in sizeof()Claudio Jeker
OK phessler@
2018-10-26When walking the list of ribs use continue instead of break after theClaudio Jeker
rib_valid() check. The list of ribs can have holes. OK benno@
2018-10-25Calculate ASPATH_HEADER_SIZE correctly by using offsetof() instead of theClaudio Jeker
sizeof calculation that did not respect possible padding bytes. OK sthen@ denis@
2018-10-24Major refactoring of the RIB handling code. Mainly change how the RIB isClaudio Jeker
walked. rib_dump_r() is now an internal function and instead the code gets an additional callback for throttling the rib_dump code. This removes a lot of similar code used to make sure the RDE is not walking to fast and replaces it with simpler callbacks. The other big change is the removal of struct rib pointers in other data structures. The rib pointers are not stable because of a realloc() call happening when extending the array so instead use the RIB ID as a reference. Tested and OK denis@ and benno@
2018-10-24Pass down the right nexthop to rde_dump_rib_as() so that dumping theClaudio Jeker
Adj-RIB-Out prints the right (modified) nexthop. Found by Marko Cupac. OK benno@
2018-10-22Properly throttle dumping of prefixes to peers. Eventhough we got the XON/XOFFClaudio Jeker
messages the RDE did not act based on them. This mostly ensures that large UPDATE runs (e.g. on peer up) are not flodding the imsg queue and therfore delaying other imsgs. OK denis@ benno@
2018-10-18In rde_update_queue_runner() reset eor on every loop else a spurious andClaudio Jeker
most probably wrong EoR could be sent out because the variable persisted over iterations.
2018-10-18Remove unneeded break, there is one just after and makes the XON and XOFFClaudio Jeker
blocks look the same.
2018-10-15Use the up_rib tree to withdraw all prefixes of a peer which is used toClaudio Jeker
reload peers into a new RIB. Removes one additional full RIB tree walker. OK benno@
2018-10-14Unbreak mrt table dumps. Make sure to call rib_dump_r for the mrt dumpClaudio Jeker
context once every poll loop until finished or data is queued. OK benno@
2018-10-10Large community setting, when checking for pre-existing community, wasTheo de Raadt
comparing with byte-order swapped, therefore it could add duplicates. ok claudio
2018-10-06some minor fixes;Jason McIntyre
2018-10-04Rework man page a bit. Add 2 new sections for Set Configuration andClaudio Jeker
Network Announcements. Move stuff accordingly and add some missing bits. Input and OK sthen@ OK benno@ just push ahead jmc@
2018-10-03add filter option based on origin validation statedenis
OK claudio@
2018-10-03Update manual to reflect ROA changesdenis
With input from claudio@, sthen@ and jmc@ OK claudio@ sthen@
2018-10-01Expose BGP Origin Validation state in bgpctl show commandsjob
OK denis@ claudio@
2018-09-30vstate might be used uninitializeddenis
OK claudio@
2018-09-29Fix problems with redistribution of routes by route label.Sebastian Benoit
Bug report from Jon Williams, jon AT jonwillia DOT ms, thanks. ok claudio@
2018-09-29Implement origin validation in bgpd. This introduces two new tables, theClaudio Jeker
roa-set for RPKI based origin validation and a origin-set which allows to lookup a source-as / prefix pair. For RPKI a config can be built like this: roa-set { 165.254.255.0/24 source-as 15562 193.0.0.0/21 maxlen 24 source-as 3333 } deny from any ovs invalid match from any ovs valid set community local-as:42 match from any ovs not-found set community local-as:43 Origin sets are similar but only match when the source-as / prefix pair is valid. match from any origin-set ARINDB set community local-as:44 Committing this now so that further work can be done in tree. OK benno@, job@
2018-09-29With the introduction of sets the config that is shipped to the RDE gotClaudio Jeker
potentially much bigger. In bad cases the SE activated the config way before the RDE which is not ideal. Introduce IMSG_RECONF_DRAIN which acts as a barrier and ensures that both childs got all the config. Only after that the IMSG_RECONF_DONE message is sent activating the config in the childs more or less simultaneous. OK benno@
2018-09-29Introduce minimal tracking of announced prefixes. A per peer RB tree tracksClaudio Jeker
which prefixes were sent out as UPDATE. At withdraw time the RB tree can be consulted to know if the withdraw actually needs to be sent to the peer. This replaces the faulty heuristic that was used before and caused either that unneeded withdraw to be sent or in the worst case failing to send a necessary withdraw resulting in stuck routes. OK benno@
2018-09-27Add some extra curlies to make code more legible.Claudio Jeker
2018-09-27unbreak "inet" and "inet6" aliases in filters after rev. 1.333Sebastian Benoit
ok claudio@
2018-09-26Rename AS_NONE to AS_UNDEF, AS_NONE will be reused for a different purposeClaudio Jeker
soon. OK compiler and grep
2018-09-26Switching bgpd to a default deny policy had one bad side-effect. SomeClaudio Jeker
withdraw were suddenly filtered out because the filter ran into the default deny. So for this case (state == NULL) change action to default allow. This bug was haunting bgpd for a while now causing prefixes to be stuck for no obvious reason. OK benno@, sthen@
2018-09-26Use the same logic in trie_roa_check_v4 as in trie_roa_check_v6 whenClaudio Jeker
checking that a source_as / maxlen combo actually fits. Fixes regress test.
2018-09-26Instead of checking that a segement is not of type AS_SET do the checkClaudio Jeker
that it is actually AS_SEQUENCE. No functional change those are the only two types bgpd supports here.
2018-09-26Indent issue. No functional changeClaudio Jeker
2018-09-25Fix loading of roa-sets in the RDE. From a much bigger diff but thisClaudio Jeker
goes in now since it fixes a real issue.
2018-09-25When sending set_tables in the imsg use the right size. Currently theClaudio Jeker
number of elements is used as size which is always wrong.
2018-09-21sync host*() changes from pfctlkn
This simplifies host() and merges host_v{4,6}() into host_ip() as recently done for pfctl and ntpd. Tested and OK denis, OK deraadt, "go ahead" benno
2018-09-21Both AS 23456 and AS 0 are reserved and can nor be used. Extend check forClaudio Jeker
AS 0 and adjust yyerror message to print the right number. With input and OK denis@
2018-09-21better yyerror messages. "syntax error" is generally not very helpful.Claudio Jeker
OK denis@