aboutsummaryrefslogtreecommitdiffstats
path: root/proto/babel
Commit message (Collapse)AuthorAgeFilesLines
* Babel: Simplify auth expirationOndrej Zajicek (work)2021-06-092-25/+11
| | | | | Just use hello_expiry for that, keep init_expiry for initial unauthentized neighbors.
* Babel: Add MAC authentication support - updateOndrej Zajicek (work)2021-06-064-187/+195
| | | | | | | | | | | | | | | | | | | | | | | | | Some cleanups and bugfixes to the previous patch, including: - Fix rate limiting in index mismatch check - Fix missing BABEL_AUTH_INDEX_LEN in auth_tx_overhead computation - Fix missing auth_tx_overhead recalculation during reconfiguration - Fix pseudoheader construction in babel_auth_sign() (sport vs fport) - Fix typecasts for ptrdiffs in log messages - Make auth log messages similar to corresponding RIP/OSPF ones - Change auth log messages for events that happen during regular operation to debug messages - Switch meaning of babel_auth_check*() functions for consistency with corresponding RIP/OSPF ones - Remove requirement for min/max key length, only those required by given MAC code are enforced
* Babel: Add MAC authentication supportToke Høiland-Jørgensen2021-06-065-24/+738
| | | | | | | | | | | This implements support for MAC authentication in the Babel protocol, as specified by RFC 8967. The implementation seeks to follow the RFC as close as possible, with the only deliberate deviation being the addition of support for all the HMAC algorithms already supported by Bird, as well as the Blake2b variant of the Blake algorithm. For description of applicability, assumptions and security properties, see RFC 8967 sections 1.1 and 1.2.
* Babel: Refactor TLV parsing code for easier reuseToke Høiland-Jørgensen2021-06-061-64/+107
| | | | | | In preparation for adding authentication checks, refactor the TLV walking code so it can be reused for a separate pass of the packet for authentication checks.
* Babel: Seqno requests are properly decoupled from neighbors when the ↵Maria Matejka2021-05-302-13/+20
| | | | | | | | | underlying interface disappears When an interface disappears, all the neighbors are freed as well. Seqno requests were anyway not decoupled from them, leading to strange segfaults. This fix adds a proper seqno request list inside neighbors to make sure that no pointer to neighbor is kept after free.
* Babel: Log the reason when refusing to run on an interfaceOndrej Zajicek (work)2021-05-101-9/+19
| | | | | | | | | The babel protocol code checks whether iface supports multicast, and whether it has a link-local address assigned. However, it doesn not give any feedback if any of those checks fail, it just silently ignores the interface. Fix this by explicitly logging when multicast check fails. Based on patch from Toke Høiland-Jørgensen, thanks!
* lib/slab: introduce sl_allocz() function and use it in BabelToke Høiland-Jørgensen2020-11-242-8/+7
| | | | | | | | | | | | | | | | The babel protocol code was initialising objects returned from the slab allocator by assigning to each of the struct members individually, but wasn't touching the NODE member while doing so. This leads to warnings on debug builds since commit: baac7009063d ("List expensive check.") To fix this, introduce an sl_allocz() variant of the slab allocator which will zero out the memory before returning it, and switch all the babel call sites to use this version. The overhead for doing this should be negligible for small objects, and in the case of babel, the largest object being allocated was being zeroed anyway, so we can drop the memset in babel_read_tlv().
* Show info from multiple protocols when protocol is not specifiedOndrej Zajicek (work)2020-06-282-16/+4
| | | | | | | | | | | 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.
* Babel: Set onlink flag for IPv4 routes with unreachable next hopOndrej Zajicek (work)2020-05-261-0/+8
| | | | | | | | | If the next hop of a route is not a reachable address, the route should be installed as onlink. This enables a configuration common in mesh networks where the mesh interface is assigned a /32 and babel handles the routing by installing onlink routes. Thanks to Toke Hoiland-Jorgensen for the patch.
* Nest: Added const to ea_show just to declare that this shouldn't really ↵Maria Matejka2020-05-011-1/+1
| | | | change anything
* Configuration strings are constant.Maria Matejka2020-04-092-4/+4
| | | | This is merely a const propagation. There was no problem in there.
* Dynamic attributes definition split whether it is bitmask or not.Maria Matejka2019-07-031-1/+1
|
* Merge branch 'master' into HEADMaria Matejka2019-03-181-31/+14
|\
| * Nest: Update handling of temporary attributesOndrej Zajicek (work)2019-03-141-31/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Filter + Config: Fix bugs, tests and split symbols by typeMaria Matejka2019-02-201-4/+4
| |
* | Filter refactoring: dropped the recursion from the interpreterMaria Matejka2019-02-201-1/+1
|/ | | | | | | | | | | | | | | | This is a major change of how the filters are interpreted. If everything works how it should, it should not affect you unless you are hacking the filters themselves. Anyway, this change should make a huge improvement in the filter performance as previous benchmarks showed that our major problem lies in the recursion itself. There are also some changes in nest and protocols, related mostly to spreading const declarations throughout the whole BIRD and also to refactored dynamic attribute definitions. The need of these came up during the whole work and it is too difficult to split out these not-so-related changes.
* Doc: Rename code documentation files back to DocOndrej Zajicek (work)2018-12-141-0/+0
|
* Terminology cleanup: The import_control hook is now called preexport.Jan Maria Matejka2018-12-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Nest: Do not hard-reset interface when preferred address is changedOndrej Zajicek (work)2018-11-281-14/+29
| | | | | | | | | | | Modify protocols to use preferred address change notification instead on depending on hard-reset of interfaces in that case, and remove hard-reset in that case. This avoids issue when e.g. IPv6 protocol restarts interface when IPv4 preferred address changed (as hard-reset is unavoidable and common for whole iface). The patch also fixes a bug when removing last address does not send preferred address change notification.
* Lib: Add and use ev_new_init()Ondrej Zajicek (work)2018-10-011-3/+1
|
* Cleanup some warningsOndrej Zajicek (work)2018-07-031-2/+1
|
* Doc: renamed progdoc files Doc -> progdoc to fix collision with doc/ folder ↵Maria Matejka2018-06-261-0/+0
| | | | on case-insensitive filesystems
* Config: Dropping CF_ADDTO.Jan Maria Matejka2018-06-261-2/+2
|
* Merge branch 'int-new' into HEADJan Maria Matejka2018-06-192-3/+7
|\
| * Babel: Fix handling of missing IPv4 next hopsOndrej Zajicek (work)2018-06-132-3/+7
| | | | | | | | | | | | | | | | In case of missing IPv4 next hop, we should skip such routes on transmit and ignore such routes on receive. Thanks to Julian Schuh for the bugreport and Toke Hoiland-Jorgensen for the original patch.
* | Nest: Removing separate tmpa from route propagationJan Maria Matejka2018-05-302-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a fundamental change of an original (1999) concept of route processing inside BIRD. During import/export, there was a temporary ea_list created which was to be used instead of the another one inside the route itself. This led to some confusion, quirks, and strange filter code that handled extended route attributes. Dropping it now. The protocol interface has changed in an uniform way -- the `struct ea_list *attrs` argument has been removed from store_tmp_attrs(), import_control(), rt_notify() and get_route_info().
* | Protocol: Introducing an enum protocol_classJan Maria Matejka2018-05-292-3/+3
|/ | | | This supersedes the EAP_* constants.
* Do not initialize route metrics in import_control hookOndrej Zajicek (work)2018-05-241-9/+3
| | | | | | | | | | | | | | | | | | During route export, the receiving protocol often initialized route metrics to default value in its import_control hook before export filter was executed. This is inconsistent with the expectation that an export filter would process the same route as one in the routing table and it breaks setting these metrics before (e.g. for static routes directly in static protocol). The patch removes the initialization of route metrics in import_control hook, the default values are already handled in rt_notify hook called after export filters. The patch also changed the behavior of OSPF to keep metrics when a route is reannounced between OSPF instances (to be consistent with other protocols) and the behavior when both ospf_metric1 and ospf_metric2 are specified (to have more expected behavior).
* Babel: Add option to randomize router IDOndrej Zajicek (work)2018-05-033-1/+14
| | | | | | | | | | | | | | | | When a Babel node restarts, it loses its sequence number, which can cause its routes to be rejected by peers until the state is cleared out by other nodes in the network (which can take on the order of minutes). There are two ways to fix this: Having stable storage to keep the sequence number across restarts, or picking a different router ID each time. This implements the latter, by introducing a new option that will cause BIRD to randomize a high 32 bits of router ID every time it starts up. This avoids the problem at the cost of not having stable router IDs in the network. Thanks to Toke Hoiland-Jorgensen for the patch.
* Babel: Fix type of route entry router IDOndrej Zajicek (work)2018-05-031-1/+1
| | | | | | | | The router ID being assigned to routes was a uint, which discards the upper 32 bits. This also has the nice side effect of echoing the wrong router ID back to other routers. Thanks to Toke Hoiland-Jorgensen for the patch.
* Merge branch 'master' into int-newOndrej Zajicek (work)2018-03-071-3/+4
|\
| * Babel: Fix build with restricted protocol setOndrej Zajicek (work)2018-03-071-2/+3
| | | | | | | | | | | | All keywords used in Babel config have to be declared locally. Thanks to Leo Vandewoestijne for the bugreport.
* | Babel: Fix accidental bitwise or assignmentOndrej Zajicek (work)2018-02-131-1/+1
| | | | | | | | | | | | | | Fix an accidental bitwise or assignment that was supposed to be a comparison. Thanks to Toke Hoiland-Jorgensen for the patch.
* | Babel: Add source-specific routing supportOndrej Zajicek (work)2018-02-133-28/+224
| | | | | | | | | | | | | | | | | | | | | | This patch adds support for source-specific routing to the Babel protocol. It changes the protocol to support both NET_IP6 and NET_IP6_SADR channels for IPv6 addresses. If only a NET_IP6 channel is configured, source-specific updates are ignored. Otherwise, non-source-specific routes are simply treated as source-specific routes with SADR prefix 0. Thanks to Toke Hoiland-Jorgensen for the original patch. Minor changes by Ondrej Santiago Zajicek.
* | Merge commit '1e8721e2aeccfbc3f533e8b8abc07582cee77e9a' into int-newOndrej Zajicek (work)2017-12-071-7/+16
|\|
| * Babel: Parse flags in Hello TLVOndrej Zajicek (work)2017-11-281-5/+14
| | | | | | | | | | | | | | | | | | RFC6126bis introduces a flags field for the Hello TLV, and adds a unicast flag that is used to signify that a hello was sent as unicast. This adds parsing of the flags field and ignores such unicast hellos, which preserves compatibility until we can add a proper implementation of the unicast hello mechanism. Thanks to Toke Hoiland-Jorgensen for the patch.
| * BGP: Shutdown communication (RFC 8203)Ondrej Zajicek (work)2017-09-191-2/+0
| | | | | | | | | | | | | | | | | | | | The patch implements BGP Administrative Shutdown Communication (RFC 8203) allowing BGP operators to pass messages related to BGP session administrative shutdown/restart. It handles both transmit and receive of shutdown messages. Messages are logged and may be displayed by show protocol all command. Thanks to Job Snijders for the basic patch.
* | Merge commit '7b2c5f3d2826e3175bf31b1c36056c9efc587a2b' into int-newOndrej Zajicek (work)2017-12-071-0/+1
|\|
| * Basic VRF supportOndrej Zajicek (work)2017-09-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add basic VRF (virtual routing and forwarding) support. Protocols can be associated with VRFs, such protocols will be restricted to interfaces assigned to the VRF (as reported by Linux kernel) and will use sockets bound to the VRF. E.g., different multihop BGP instances can use diffent kernel routing tables to handle BGP TCP connections. The VRF support is preliminary, currently there are several limitations: - Recent Linux kernels (4.11) do not handle correctly sockets bound to interaces that are part of VRF, so most protocols other than multihop BGP do not work. This will be fixed by future kernel versions. - Neighbor cache ignores VRFs. Breaks config with the same prefix on local interfaces in different VRFs. Not much problem as single hop protocols do not work anyways. - Olock code ignores VRFs. Breaks config with multiple BGP peers with the same IP address in different VRFs. - Incoming BGP connections are not dispatched according to VRFs. Breaks config with multiple BGP peers with the same IP address in different VRFs. Perhaps we would need some kernel API to read VRF of incoming connection? Or probably use multiple listening sockets in int-new branch. - We should handle master VRF interface up/down events and perhaps disable associated protocols when VRF goes down. Or at least disable associated interfaces. - Also we should check if the master iface is really VRF iface and not some other kind of master iface. - BFD session request dispatch should be aware of VRFs. - Perhaps kernel protocol should read default kernel table ID from VRF iface so it is not necessary to configure it. - Perhaps we should have per-VRF default table.
* | Timers: Revert temporary names and remove old timer.hOndrej Zajicek (work)2017-12-072-9/+9
| |
* | Babel: More changes and bugfixesOndrej Zajicek (work)2017-12-074-293/+315
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several changes and bugfixes in Babel, namely: - Exported route parameters stored directly in route table entry - Exported non-babel routes no longer stored in per-entry route list - Route update, selection and retraction simplified and fixed - Route feasibility is evalualated per update and stored with route - Unreachable route handling fixed, based on hold interval - Added 'show babel routes' command Overall, it fixes some issues with proper propagation of triggered updates, making Babel convergence after topology change almost instant.
* | Babel: Fix handling of seqno requestsOndrej Zajicek (work)2017-12-072-142/+187
| | | | | | | | | | Old behavior has several deficiencies compared to standard behavior (no triggered updates for replies, no retransmissions, ...).
* | Babel: Fix handling of IPv4 retractionsOndrej Zajicek (work)2017-12-071-2/+2
| | | | | | | | | | Babel TLV parsing code rejected IPv4 retractions without next-hop, although next-hop is needed just for regular updates.
* | Babel: Remove babel_proto ptr from babel_entryOndrej Zajicek (work)2017-12-072-47/+34
| |
* | Babel: Fix hello timeout for short hello intervalsOndrej Zajicek (work)2017-12-071-5/+9
| |
* | Babel: Revamp cost computation and run route selection when cost changeOndrej Zajicek (work)2017-12-073-87/+137
| | | | | | | | | | | | Also fix several minor bugs and add 'limit' option for k-out-of-j link sensing strategy. Change default from 8-of-16 to 12-of-16. Change IHU expiry factor from 1.5 to 3.5 (as in RFC 6126).
* | Babel: Fix unicast seqno requestsOndrej Zajicek (work)2017-12-071-26/+18
| |
* | Babel: Avoid batch seqno updatesOndrej Zajicek (work)2017-12-072-2/+10
| |
* | Babel: Fix Hello and IHU expirationOndrej Zajicek (work)2017-12-072-1/+6
| |
* | Babel: Update to new timersOndrej Zajicek (work)2017-12-074-125/+136
| |