summaryrefslogtreecommitdiff
path: root/proto/ospf/ospf.c
AgeCommit message (Collapse)Author
2023-04-04Propagated const through route feed routinesMaria Matejka
2023-02-07Merge commit '0bb04d5390f21b0c96fc4894ba5d5510c541f0ef' into HEADMaria Matejka
2023-02-02Interface updates are asynchronousMaria Matejka
Instead of propagating interface updates as they are loaded from kernel, they are enqueued and all the notifications are called from a protocol-specific event. This change allows to break the locking loop between protocols and interfaces. Anyway, this change is based on v2 branch to keep the changes between v2 and v3 smaller.
2022-08-02Merge commit 'f0507f05ce57398e135651896dace4cb68eeed54' into thread-nextMaria Matejka
2022-07-13Merge commit 'd429bc5c841a8e9d4c81786973edfa56d20a407e' into thread-nextMaria Matejka
2022-07-11Merge commit 'beb5f78a' into backportMaria Matejka
2022-06-27Preexport callback now takes the channel instead of protocol as argumentMaria Matejka
Passing protocol to preexport was in fact a historical relic from the old times when channels weren't a thing. Refactoring that to match current extensibility needs.
2022-06-08Merge commit '938742decc6e1d6d3a0375dd012b75172e747bbc' into haugesundMaria Matejka
2022-05-30Merge commit '1c30b689ddd032ef8000fb7836348a48ba3184ff' into haugesundMaria Matejka
2022-05-30Merge commit '337c04c45e1472d6d9b531a3c55f1f2d30ebf308' into haugesundMaria Matejka
2022-05-30Merge commit 'd8661a4397e4576ac404661b192dd99d928e7890' into haugesundMaria Matejka
2022-05-30Merge commit '17f91f9e6e70f7e3f29502e854823c0d48571eaa' into haugesundMaria Matejka
2022-05-30Merge commit 'd39ef961d1dde230c55fcc931b53f44cb34a1e63' into haugesundMaria Matejka
2022-05-30Merge commit '4a23ede2b056a41456790cc20a0c3d92a7137693' into haugesundMaria Matejka
2022-05-30Squashing the route attribute structure into one level.Maria Matejka
For now, all route attributes are stored as eattrs in ea_list. This should make route manipulation easier and it also allows for a layered approach of route attributes where updates from filters will be stored as an overlay over the previous version.
2022-05-04Moved route source attribute (RTS_*) to eattrsMaria Matejka
2022-05-04Moved route preference to eattrsMaria Matejka
2022-05-04Explicit definition structures of route attributesMaria Matejka
Changes in internal API: * Every route attribute must be defined as struct ea_class somewhere. * Registration of route attributes known at startup must be done by ea_register_init() from protocol build functions. * Every attribute has now its symbol registered in a global symbol table defined as SYM_ATTRIBUTE * All attribute ID's are dynamically allocated. * Attribute value custom formatting hook is defined in the ea_class. * Attribute names are the same for display and filters, always prefixed by protocol name. Also added some unit testing code for filters with route attributes.
2022-04-06Protocols have their own explicit init routinesMaria Matejka
2022-04-06All linpools use pages to allocate regular blocksMaria Matejka
2021-11-22Route sources have an explicit ownerMaria Matejka
This commit prevents use-after-free of routes belonging to protocols which have been already destroyed, delaying also all the protocols' shutdown until all of their routes have been finally propagated through all the pipes down to the appropriate exports. The use-after-free was somehow hypothetic yet theoretically possible in rare conditions, when one BGP protocol authors a lot of routes and the user deletes that protocol by reconfiguring in the same time as next hop update is requested, causing rte_better() to be called on a not-yet-pruned network prefix while the owner protocol has been already freed. In parallel execution environments, this would happen an inter-thread use-after-free, causing possible heisenbugs or other nasty problems.
2021-11-09Split route data structure to storage (ro) / manipulation (rw) structures.Maria Matejka
Routes are now allocated only when they are just to be inserted to the table. Updating a route needs a locally allocated route structure. Ownership of the attributes is also now not transfered from protocols to tables and vice versa but just borrowed which should be easier to handle in a multithreaded environment.
2021-10-13OSPF: Convert the rte-local attributes to extended attributesMaria Matejka
2021-10-13IGP metric getter refactoring to protocol callbackMaria Matejka
Direct protocol hooks for IGP metric inside nest/rt-table.c make the protocol API unnecessarily complex. Instead, we use a proper callback.
2021-10-13Route: moved rte_src pointer from rta to rteMaria Matejka
It is an auxiliary key in the routing table, not a route attribute.
2021-10-13Preference moved to RTA and set explicitly in protocolsMaria Matejka
2021-10-13Preexport: No route modification, no linpool neededMaria Matejka
2021-10-13OSPF: explicitly stop the periodic tick on shutdown to avoid recalculation racesMaria Matejka
2020-06-28Show info from multiple protocols when protocol is not specifiedOndrej Zajicek (work)
Most commands like 'show ospf neighbors' fail when protocol is not specified and there are multiple instances of given protocol type. This is annoying in BIRD 2, as many protocols have IPv4 and IPv6 instances. The patch changes that by showing output from all protocol instances of appropriate type. Note that the patch also removes terminating cli_msg() call from these commands and moves it to the common iterating code.
2020-05-01Nest: Added const to ea_show just to declare that this shouldn't really ↵Maria Matejka
change anything
2020-05-01OSPF: variable-length array of size 0 replaced by alloca()'d pointerMaria Matejka
NULL pointer is safer than a random pointer onto stack if this function gets changed and eventually broken.
2020-04-09Configuration strings are constant.Maria Matejka
This is merely a const propagation. There was no problem in there.
2019-07-24Merge remote-tracking branch 'origin/mq-filter-stack'Ondrej Zajicek (work)
2019-07-23OSPF: Fix formatting of 'show ospf neighbors'Ondrej Zajicek (work)
The formatting was broken when too short router-id was used.
2019-07-15Merge remote-tracking branch 'origin/master' into mq-filter-stackMaria Matejka
2019-07-10OSPF: Fix handling of NSSA option flagsOndrej Zajicek (work)
Per RFC 3101, N-bit signalling NSSA support should be used only in Hello packets, not in DBDES packets. BIRD since 2.0.4 verifies N-bit in neighbor structure, which is learned from DBDES packets, therefore NSSA-LSAs are not propagated to proper implementations of RFC 3101. This patch fixes that. Both removing the check and removing N-bit from DBDES packet. This will fix compatibility issues with proper implementations, but causes compatibility issues with BIRD 2.0.4.
2019-07-10Merge branch 'master' into mq-filter-stackMaria Matejka
2019-07-09OSPF: Fix handling of external routes on graceful restartOndrej Zajicek (work)
We need to flush learned external LSAs a bit later than other LSAs (after first feed after end of the graceful restart) to avoid flap of external routes.
2019-07-03Merge branch 'master' into mq-filter-stackMaria Matejka
2019-06-30OSPF: Support for graceful restartOndrej Zajicek (work)
Implement OSPFv2 (RFC 3623) and OSPFv3 (RFC 5187) graceful restart, for both restarting and helper sides. Graceful restart is initiated by 'graceful down' command.
2019-03-18Merge branch 'master' into HEADMaria Matejka
2019-03-14Nest: Update handling of temporary attributesOndrej Zajicek (work)
The temporary atttributes are no longer removed by ea_do_prune(), but they are undefined by store_tmp_attrs() protocol hooks. This fixes several bugs where temporary attributes were removed when they should not or not removed when they should be. The flag EAF_TEMP is no longer needed and was removed. Update all protocol make_tmp_attrs() / store_tmp_attrs() hooks to use helper functions and to handle unset attributes properly. Also fix some related bugs like improper handling of empty eattr list.
2019-03-06OSPF: Improved handling of tmpattrsOndrej Zajicek (work)
Keep track of whether OSPF tmpattrs are actually defined for given route (using flags in rte->pflags). That makes them behave more like real eattrs so a protocol can define just a subset of them or they can be undefined by filters. Do not set ospf_metric2 for other than type 2 external OSPF routes and do not set ospf_tag for non-external OSPF routes. That also fixes a bug where internal/inter-area route propagated from one OSPF instance to another is initiated with infinity ospf_metric2. Thanks to Yaroslav Dronskii for the bugreport.
2019-02-20Filter + Config: Fix bugs, tests and split symbols by typeMaria Matejka
2019-02-17OSPF: Reset LSAs during area type changeOndrej Zajicek (work)
When area is reconfigured to a different type, we need to flush LSAs as they may not be valid (e.g. NSSA-LSA for non-NSSA area). Also, when we have have just one OSPF area and that changes type, we could restart OSPF as there is no state to keep anyway. That solves issue with different handling of external routes exported to OSPF based of main area type.
2019-02-13OSPF: Basic support for DN-bit handling (RFC 4576)Ondrej Zajicek (work)
External LSAs originated by OSPF routers with VPN-PE behavior enabled are marked by DN flag and they are ignored by other OSPF routers with VPN-PE enabled.
2019-01-24OSPF: Opaque LSAs and Router Information LSAOndrej Zajicek (work)
Add support for OSPFv2 Opaque LSAs (RFC 5250) and for Router Information LSA (RFC 7770). The second part is here mainly for testing opaque LSAs.
2018-12-12Update RFC referencesOndrej Zajicek (work)
Progdoc comments do not allow SGML tags
2018-12-04Terminology cleanup: The import_control hook is now called preexport.Jan Maria Matejka
Once upon a time, far far away, there were the old Bird developers discussing what direction of route flow shall be called import and export. They decided to say "import to protocol" and "export to table" when speaking about a protocol. When speaking about a table, they spoke about "importing to table" and "exporting to protocol". The latter terminology was adopted in configuration, then also the bird CLI in commit ea2ae6dd0 started to use it (in year 2009). Now it's 2018 and the terminology is the latter. Import is from protocol to table, export is from table to protocol. Anyway, there was still an import_control hook which executed right before route export. One thing is funny. There are two commits in April 1999 with just two minutes between them. The older announces the final settlement on config terminology, the newer uses the other definition. Let's see their commit messages as the git-log tool shows them (the newer first): commit 9e0e485e50ea74c4f1c5cb65bdfe6ce819c2cee2 Author: Martin Mares <mj@ucw.cz> Date: Mon Apr 5 20:17:59 1999 +0000 Added some new protocol hooks (look at the comments for better explanation): make_tmp_attrs Convert inline attributes to ea_list store_tmp_attrs Convert ea_list to inline attributes import_control Pre-import decisions commit 5056c559c4eb253a4eee10cf35b694faec5265eb Author: Martin Mares <mj@ucw.cz> Date: Mon Apr 5 20:15:31 1999 +0000 Changed syntax of attaching filters to protocols to hopefully the final version: EXPORT <filter-spec> for outbound routes (i.e., those announced by BIRD to the rest of the world). IMPORT <filter-spec> for inbound routes (i.e., those imported by BIRD from the rest of the world). where <filter-spec> is one of: ALL pass all routes NONE drop all routes FILTER <name> use named filter FILTER { <filter> } use explicitly defined filter For all protocols, the default is IMPORT ALL, EXPORT NONE. This includes the kernel protocol, so that you need to add EXPORT ALL to get the previous configuration of kernel syncer (as usually, see doc/bird.conf.example for a bird.conf example :)). Let's say RIP to this almost 19-years-old inconsistency. For now, if you import a route, it is always from protocol to table. If you export a route, it is always from table to protocol. And they lived happily ever after.
2018-10-01Lib: Add and use ev_new_init()Ondrej Zajicek (work)