summaryrefslogtreecommitdiff
path: root/proto/bgp/packets.c
AgeCommit message (Collapse)Author
2023-04-18BMP: Allow build without BMP and disable BMP build by defaultOndrej Zajicek
It has still several important issues to be enabled by default.
2023-04-16BMP: Remove duplicate functions for update encodingOndrej Zajicek (work)
Use existing BGP functions also for BMP update encoding.
2023-04-16BMP protocol supportPawel Maslanka
Initial implementation of a basic subset of the BMP (BGP Monitoring Protocol, RFC 7854) from Akamai team. Submitted for further review and improvement.
2023-02-19BGP: Update RFC referencesOndrej Zajicek
2023-01-20BGP: Add received role value to role mismatch log messageOndrej Zajicek
2023-01-01Nest: Fix several issues with pflagsOndrej Zajicek
There were some confusion about validity and usage of pflags, which caused incorrect usage after some flags from (now removed) protocol- specific area were moved to pflags. We state that pflags: - Are secondary data used by protocol-specific hooks - Can be changed on an existing route (in contrast to copy-on-write for primary data) - Are irrelevant for propagation (not propagated when changed) - Are specific to a routing table (not propagated by pipe) The patch did these fixes: - Do not compare pflags in rte_same(), as they may keep cached values like BGP_REF_STALE, causing spurious propagation. - Initialize pflags to zero in rte_get_temp(), avoid initialization in protocol code, fixing at least two forgotten initializations (krt and one case in babel). - Improve documentation about pflags
2022-12-10BGP: Log unacceptable hold time as decimal numberOndrej Zajicek
Thanks Johannes Moos for the suggestion.
2022-12-09BGP: Improve handling of hold and keepalive timersOndrej Zajicek
The effective keepalive time now scales relative to the negotiated hold time, to maintain proportion between the keepalive time and the hold time. This avoids issues when both keepalive and hold times were configured, the hold time was negotiated to a smaller value, but the keepalive time stayed the same. Add new options 'min hold time' and 'min keepalive time', which reject session attempts with too small hold time. Improve validation of config options an their documentation. Thanks to Alexander Zubkov and Sergei Goriunov for suggestions.
2022-10-10BGP: Add option 'next hop prefer global'Ondrej Zajicek
Add BGP channel option 'next hop prefer global' that modifies BGP recursive next hop resolution to use global next hop IPv6 address instead of link-local next hop IPv6 address for immediate next hop of received routes.
2022-10-03BGP: Some fixes related to VRF and MPLS interactionsOndrej Zajicek
- When next hop is reset to local IP, we should remove BGP label stack, as it is related to original next hop - BGP next hop or immediate next hop from one VRF should not be passed to another VRF, as they are different IP namespaces
2022-10-03BGP: Do not assume that all channels are struct bgp_channelOndrej Zajicek
In principle, the channel list is a list of parent struct proto and can contain general structures of type struct channel, That is useful e.g. for adding MPLS channels to BGP.
2022-07-24Merge branch 'master' into backportOndrej Zajicek
2022-07-11BGP: Implement BGP rolesEugene Bogomazov
Implement BGP roles as described in RFC 9234. It is a mechanism for route leak prevention and automatic route filtering based on common BGP topology relationships. It defines role capability (controlled by 'local role' option) and OTC route attribute, which is used for automatic route filtering and leak detection. Minor changes done by commiter.
2022-04-06BGP uses lp_save / lp_restore instead of linpool flushingMaria Matejka
It is too cryptic to flush tmp_linpool in these cases and we don't want anybody in the future to break this code by adding an allocation somewhere which should persist over that flush. Saving and restoring linpool state is safer.
2022-04-06Eattr flags (originated and fresh) get their own struct fieldsMaria Matejka
2022-03-09Merge commit '60880b539b8886f76961125d89a265c6e1112b7a' into haugesundMaria Matejka
2022-03-09BGP Flowspec validation: Removed in-route optimization for multithreading ↵Maria Matejka
compatibility
2022-03-09Merge commit '5cff1d5f' into haugesundMaria Matejka
Conflicts: proto/bgp/attrs.c proto/pipe/pipe.c
2022-03-02Replacing BGP temporary linpools by the common temporary linpoolMaria Matejka
2022-02-06Merge branch 'oz-trie-table'Ondrej Zajicek (work)
2022-02-06BGP: Implement flowspec validation procedureOndrej Zajicek (work)
Implement flowspec validation procedure as described in RFC 8955 sec. 6 and RFC 9117. The Validation procedure enforces that only routers in the forwarding path for a network can originate flowspec rules for that network. The patch adds new mechanism for tracking inter-table dependencies, which is necessary as the flowspec validation depends on IP routes, and flowspec rules must be revalidated when best IP routes change. The validation procedure is disabled by default and requires that relevant IP table uses trie, as it uses interval queries for subnets.
2022-01-28BGP: Make routing loops silentOndrej Zajicek (work)
One of previous commits added error logging of invalid routes. This also inadvertently caused error logging of route loops, which should be ignored silently. Fix that.
2022-01-28BGP: Use proper class in attribute error messagesOndrej Zajicek (work)
Most error messages in attribute processing are in rx/decode step and these use L_REMOTE log class. But there are few that are in tx/export step and these should use L_ERR log class. Use tx-specific macro (REJECT()) in tx/export code and rename field err_withdraw to err_reject in struct bgp_export_state to ensure that appropriate error reporting macros are called in proper contexts.
2022-01-28BGP: Improve 'invalid next hop' error reportingOndrej Zajicek (work)
Distinguish multiple causes of 'invalid next hop' message and report the relevant next hop address. Thanks to Simon Ruderich for the original patch.
2022-01-24BGP: Log route updates that were changed to withdrawsOndrej Zajicek (work)
Typical BGP error handling is treat-as-withdraw, where an invalid route is replaced with a withdraw. Log route network when it happens.
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-13BGP: Moved the suppressed and stale flags to pflagsMaria Matejka
2021-06-01BGP: Ensure that freed neighbor entry is not accessedOndrej Zajicek (work)
Routes from downed protocols stay in rtable (until next rtable prune cycle ends) and may be even exported to another protocol. In BGP case, source BGP protocol is examined, although dynamic parts (including neighbor entries) are already freed. That may lead to crash under some race conditions. Ensure that freed neighbor entry is not accessed to avoid this issue.
2021-02-10BGP: Add support for BGP hostname capabilityVincent Bernat
This is an implementation of draft-walton-bgp-hostname-capability-02. It is implemented since quite some time for FRR and in datacenter, this gives a nice output to avoid using IP addresses. It is disabled by default. The hostname is retrieved from uname(2) and can be overriden with "hostname" option. The domain name is never set nor displayed. Minor changes by committer.
2020-04-29BGP: Fix handling of strange IPv6 link-local-only next hopsOndrej Zajicek (work)
There are three common ways how to encode IPv6 link-local-only next hops: (:: ll), (ll), and (ll ll). We use the first one but we should accept all three. The patch fixes handling of the last one. Thanks to Sebastian Hahn for the bugreport.
2020-03-03BGP: Handle flowspec rules without dst partOndrej Zajicek (work)
The RFC 5575 does not explicitly reject flowspec rules without dst part, it just requires dst part in validation procedure for feasibility, which we do not implement anyway. Thus flow without dst prefix is syntactically valid, but unfeasible (if feasibilty testing is done). Thanks to Alex D. for the bugreport.
2019-12-03BGP: Add some statisticsOndrej Zajicek (work)
Add some statistic counters to BGP consistent with BGP MIB (RFC 4273), including persistent 'FSM established transitions'.
2019-11-18BGP: Fix processing of IPv6 FlowspecOndrej Zajicek (work)
During NLRI parsing of IPv6 Flowspec, dst prefix was not properly extracted from NLRI, therefore a received flow was stored in a different position in flowspec routing table, and was not reachable by command 'show route <flow>'. Add proper prefix part accessors to flowspec code and use them from BGP NLRI parsing code. Thanks to Alex D. for the bugreport.
2019-10-09BGP: AIGP metric support (RFC 7311)Ondrej Zajicek (work)
2019-09-09BGP: Fix bugs in handling of shutdown messagesOndrej Zajicek (work)
There is an improper check for valid message size, which may lead to stack overflow and buffer leaks to log when a large message is received. Thanks to Daniel McCarney for bugreport and analysis.
2019-08-21BGP: Use reallocation for capability structureOndrej Zajicek (work)
Instead of having large stack buffer for max amount of AFI/SAFI pairs. The old code is not correct w.r.t. extendeded option length, as more AFI/SAFI pairs may fit into the capability option.
2019-08-20BGP: Implement extended optional parameters lengthOndrej Zajicek (work)
Extends BGP options/capabilities data length to 16bit, to avoid issues with too many capabilities. See draft-ietf-idr-ext-opt-param-07
2019-07-03Merge branch 'master' into mq-filter-stackMaria Matejka
2019-07-01BGP: split tx explicitlyMaria Jan Matejka
If BGP has too many data to send and BIRD is slower than the link, TX is always possible until all data is sent. This patch limits maximum number of generated BGP messages in one iteration of TX hook.
2019-04-30BGP: Compliance with RFC8203bisAlexander Azimov
2019-04-08BGP: Handle corner cases in event orderingOndrej Zajicek (work)
When BGP connection is opened, it may happen that rx hook (with remote OPEN) is called before tx hook (for local OPEN). Therefore, we need to do internal changes (like setting local_caps) synchronously with OPENSENT transition and we need to ensure that OPEN is sent before KEEPALIVE.
2019-04-03BGP: Promiscuous ASN modeOndrej Zajicek (work)
Allow to specify just 'internal' or 'external' for remote neighbor instead of specific ASN. In the second case that means BGP peers with any non-local ASNs are accepted.
2019-04-02BGP: Separate runtime and config usage of local/remote ip and as fieldsOndrej Zajicek (work)
2019-03-19BGP: Mandatory option for channelsOndrej Zajicek (work)
Allow to mark channel to be mandatory, and do not allow BGP sessions if no common AFI/SAFI is established.
2019-03-18BGP: Handle case where capabilites are not usedOndrej Zajicek (work)
If peer does not announce capabilities at all, or when we have capabilities disabled, handle that as implicit IPv4 unicast.
2019-02-20Filter refactoring: dropped the recursion from the interpreterMaria Matejka
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.
2018-12-16BGP: Extend 'next hop keep' and 'next hop self' optionsOndrej Zajicek (work)
Extend 'next hop keep' and 'next hop self' options to have boolean values (enabled / disabled) and also values 'ibgp'/ 'ebgp' to restrict it to routes received from IBGP / EBGP. This allows to have it enabled by default in some cases, matches features of other implementations, and allows to handle some strange cases like EBGP border router with 'next hop self' also doing IBGP route reflecting. Change default of 'next hop keep' to enabled for route servers, and 'ibgp' for route reflectors. Update documentation for these options.
2018-12-16BGP: Better handling of non-matching AFI in nexthopsOndrej Zajicek (work)
2018-12-12BGP: implement Adj-RIB-InOndrej Zajicek (work)
The patch implements optional internal import table to a channel and hooks it to BGP so it can be used as Adj-RIB-In. When enabled, all received (pre-filtered) routes are stored there and import filters can be re-evaluated without explicit route refresh. An import table can be examined using e.g. 'show route import table bgp1.ipv4'.