summaryrefslogtreecommitdiff
path: root/bgpd/bgp_open.c
AgeCommit message (Collapse)Author
2025-02-08bgpd: Do not check for capability length for Link-Local Next Hop capabilityDonatas Abraitis
Capability's length is 0 and this is not needed to check if it's multiplied by X or there is a minimum length for that. Fixes: db853cc97eafee8742cd391aaa2b5bc58a6751ae ("bgpd: Implement Link-Local Next Hop capability") Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2025-01-17bgpd: Implement Link-Local Next Hop capabilityDonatas Abraitis
Related: https://datatracker.ietf.org/doc/html/draft-white-linklocal-capability TL;DR; use 16 bytes long next-hops for point-to-point (unnumbered) links instead of sending 32 bytes (::/LL, GUA/LL, LL/LL combinations). For backward compatiblity we should handle even 32 bytes existing next hops. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-09-01bgpd: Print errors as error not as information when parsing OPEN messageDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-07-01bgpd: Refine OPEN debug logs for graceful restartvivek
This also fixes Rx F-bit log which was incorrect. Signed-off-by: Vivek Venkatraman <vivek@nvidia.com>
2024-07-01bgpd: Refine restarter operation - R-bit & F-bitvivek
Introduce BGP-wide flags to denote if BGP has started gracefully and GR is in progress or not. Use this for setting of the R-bit in the GR capability, and not a timer which is set for any new instance creation. Mark graceful restart is complete when the deferred path selection has been done and route sync with zebra as well as deferred EOR advertisement has been initiated. Introduce a function to check on F-bit setting rather than just base it on configuration. Subsequent commits will extend these functionalities. Signed-off-by: Vivek Venkatraman <vivek@nvidia.com>
2024-05-24bgpd: Add sanity check for capability lengths before processing themDonatas Abraitis
This is for CAPABILITY messages, not for OPEN message capabilities. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-05-17bgpd: Fix logging message when receiving a software version capabilityDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-04-18bgpd: Include capabilities when sending NOTIFICATION(7)Donatas Abraitis
RFC5492 says: This document defines a new Error Subcode, Unsupported Capability. The value of this Subcode is 7. The Data field in the NOTIFICATION message MUST list the set of capabilities that causes the speaker to send the message. Each such capability is encoded in the same way as it would be encoded in the OPEN message. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-03-20bgpd: Enable BGP dynamic capability by default for datacenter profileDonatas Abraitis
Dynamic capability provides more value without resetting the sessions for some important other capabilities to exchange, like: graceful-restart, addpath, orf, fqdn, etc. Since we support it already, enable it by default. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-03-09bgpd: Fix `no` form for `neighbor X capability software-version`Donatas Abraitis
If `bgp default software-version-capability` is enabled, allow unsetting this for a single neighbor also. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-02-13bgpd: Implement Paths-Limit capabilityDonatas Abraitis
https://datatracker.ietf.org/doc/html/draft-abraitis-idr-addpath-paths-limit Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-02-02bgpd: add [no]neighbor capability fqdn commandFrancois Dumontet
cisco routers are not dealing fairly whith unsupported capabilities. When a cisco router receive an unsupported capabilities it reset the negociation without notifying the unmatching capability as described in RFC2842. Cisco suggest the use of neighbor x.x.x.x capability fqdn to avoid the use of fqdn in open message. this new command is to remove the use of fqdn capability in the open message with the peer "x.x.x.x". Link: https://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/116189-problemsolution-technology-00.pdf Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
2024-01-16bgpd: Send notification if AS4 capability failed to parse (malformed)Donatas Abraitis
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-01-16bgpd: Set role capability received flag only if parsed correctlyDonatas Abraitis
If we receive a malformed packet, we might end-up with a bad state. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-01-16bgpd: Set hostname capability received flag only if parsed correctlyDonatas Abraitis
If we receive a malformed packet, we might end-up with a bad state. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-01-16bgpd: Set ADD-PATH capability received flag only if parsed correctlyDonatas Abraitis
If we receive a malformed packet, we might end-up with a bad state. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2024-01-16bgpd: Set AS4 capability received flag only if parsed correctlyDonatas Abraitis
If we receive a malformed packet, we might end-up with a bad state. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-12-18Merge pull request #15036 from ↵Donald Sharp
opensourcerouting/fix/use_constants_for_addpath_cap_length bgpd: Use CAPABILITY_CODE_ADDPATH_LEN instead of numeric value
2023-12-17bgpd: Validate Addpath capability flags per AFDonatas Abraitis
Send/Receive: This field indicates whether the sender is (a) able to receive multiple paths from its peer (value 1), (b) able to send multiple paths to its peer (value 2), or (c) both (value 3) for the <AFI, SAFI>. If any other value is received, then the capability SHOULD be treated as not understood and ignored [RFC5492]. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-12-17bgpd: Use CAPABILITY_CODE_ADDPATH_LEN instead of numeric valueDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-11-08bgpd: Send software version capability for OAD EBGP peersDonatas Abraitis
We send this capability for iBGP peers by default. Recently OAD support was merged, and we should adopt sending the capability according to OAD as well. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-11-08bgpd: Set the software version capability received flag only after a validationDonatas Abraitis
We shouldn't set it blindly once the packet is received, but first we have to do some sanity checks. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-10-17bgpd: Reuse orf_type_str/orf_mode_str for dynamic capabilities codeDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-10-12build: add -Wimplicit-fallthroughIgor Ryzhov
Also: - replace all /* fallthrough */ comments with portable fallthrough; pseudo keyword to accomodate both gcc and clang - add missing break; statements as required by older versions of gcc - cleanup some code to remove unnecessary fallthrough Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2023-10-11Merge pull request #14528 from ↵Russ White
opensourcerouting/feature/bgpd_handle_addpath_capability_via_dynamic_capability bgpd: Handle Addpath capability using dynamic capabilities
2023-10-10Revert "lib: register bgp link-state afi/safi"Donald Sharp
This reverts commit 1642a68d60cfade4b2fce72aaef58dea700c65c3.
2023-10-10Revert "bgpd: accept bgp link-state capability"Donald Sharp
This reverts commit 67fe40676eb4e2ca78a41ddd70887af09b29fd9d.
2023-10-03bgpd: Clear addpath RX flag if it's absentDonatas Abraitis
When we have RX/TX flags, but received only TX, we should clear RX flag, to avoid receiving additional paths. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-09-26Merge pull request #12649 from louis-6wind/bgp-link-stateRuss White
bgpd: add basic support of BGP Link-State RFC7752
2023-09-18bgpd: accept bgp link-state capabilityLouis Scalbert
Accept the BGP Link-State AFI/SAFI capability when received from a peer OPEN message. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com> Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2023-09-18lib: register bgp link-state afi/safiLouis Scalbert
Register BGP Link-State AFI/SAFI values from RFC7752. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com> Signed-off-by: Olivier Dugeon <olivier.dugeon@orange.com>
2023-09-13bgpd: Move BGP_CAP_LLGR_MIN_PACKET_LEN to headers fileDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-09-10bgpd: Move the peer->su to connection->suDonald Sharp
The sockunion is per connection. So let's move it over. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-09-09bgpd: bgp_notify_send use peer_connection instead of peerDonald Sharp
The bgp_notify_send function should use a peer_connection Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-08-29bgpd: Use zlog_err and not zlog_info when we have an error for dynamic ↵Donatas Abraitis
capability Also change the outputs a bit to be consistent and more detailed. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-08-20bgpd: Check the length of the rcv software versionDonatas Abraitis
Make sure we don't exceed the maximum of BGP_MAX_SOFT_VERSION. The Capability Length SHOULD be no greater than 64. Reported-by: Iggy Frankovic <iggyfran@amazon.com> Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-07-18bgpd: Send software-version capability by defaultDonatas Abraitis
Useful to have it for datacenter profile only, disabled for traditional. If the peer is not established or established, but has no description set, we will show the FRR version instead, which is kinda handy to have instead of nothing. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-07-07bgpd: Deprecate Prestandard Outbound Route Filtering capabilityDonatas Abraitis
https://www.rfc-editor.org/rfc/rfc8810.html Not relevant anymore. Use RFC'd version of ORF. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-07-07bgpd: Deprecate Prestandard Route Refresh capability (128)Donatas Abraitis
More details: https://www.rfc-editor.org/rfc/rfc8810.html Not sure if we want to maintain the old code more. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-07-07bgpd: Drop deprecated capability (dynamic 66)Donatas Abraitis
Already deprecated since two decades. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-03-24Merge pull request #12953 from donaldsharp/struct_eventJafar Al-Gharaibeh
Struct event
2023-03-24bgpd: Check 7 bytes for Long-lived Graceful-Restart capabilityDonatas Abraitis
It's not 4 bytes, it was assuming the same as Graceful-Restart tuples. LLGR has more 3 bytes (Long-lived Stale Time). Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-03-24*: Convert event.h to frrevent.hDonald Sharp
We should probably prevent any type of namespace collision with something else. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Rename thread.[ch] to event.[ch]Donald Sharp
This is a first in a series of commits, whose goal is to rename the thread system in FRR to an event system. There is a continual problem where people are confusing `struct thread` with a true pthread. In reality, our entire thread.c is an event system. In this commit rename the thread.[ch] files to event.[ch]. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-02-17Merge pull request #12780 from opensourcerouting/spdx-license-idDonald Sharp
*: convert to SPDX License identifiers
2023-02-15bgpd: Add BGP Software Version CapabilityDonatas Abraitis
Implement: https://datatracker.ietf.org/doc/html/draft-abraitis-bgp-version-capability Tested with GoBGP: ``` % ./gobgp neighbor 192.168.10.124 BGP neighbor is 192.168.10.124, remote AS 65001 BGP version 4, remote router ID 200.200.200.202 BGP state = ESTABLISHED, up for 00:01:49 BGP OutQ = 0, Flops = 0 Hold time is 3, keepalive interval is 1 seconds Configured hold time is 90, keepalive interval is 30 seconds Neighbor capabilities: multiprotocol: ipv4-unicast: advertised and received ipv6-unicast: advertised route-refresh: advertised and received extended-nexthop: advertised Local: nlri: ipv4-unicast, nexthop: ipv6 UnknownCapability(6): received UnknownCapability(9): received graceful-restart: advertised and received Local: restart time 10 sec ipv6-unicast ipv4-unicast Remote: restart time 120 sec, notification flag set ipv4-unicast, forward flag set 4-octet-as: advertised and received add-path: received Remote: ipv4-unicast: receive enhanced-route-refresh: received long-lived-graceful-restart: advertised and received Local: ipv6-unicast, restart time 10 sec ipv4-unicast, restart time 20 sec Remote: ipv4-unicast, restart time 0 sec, forward flag set fqdn: advertised and received Local: name: donatas-pc, domain: Remote: name: spine1-debian-11, domain: software-version: advertised and received Local: GoBGP/3.10.0 Remote: FRRouting/8.5-dev-MyOwnFRRVersion-gdc92f44a45-dirt cisco-route-refresh: received Message statistics: ``` FRR side: ``` root@spine1-debian-11:~# vtysh -c 'show bgp neighbor 192.168.10.17 json' | \ > jq '."192.168.10.17".neighborCapabilities.softwareVersion.receivedSoftwareVersion' "GoBGP/3.10.0" root@spine1-debian-11:~# ``` Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2023-02-09*: auto-convert to SPDX License IDsDavid Lamparter
Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-01-31bgpd: Add missing enum's to case statementDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-01-14bgpd: Deprecate some unused BGP stuffDonatas Abraitis
* BGP optional parameter type (Authentication) * BGP UPDATE message error subcode for AS loop Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
2022-12-06bgpd: Adopt addpath functionality for labeled-unicastDonatas Abraitis
The same as for RIB, labeled-unicast allocations should live in unicast space. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>