summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_debug.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #14342 from fdumontet6WIND/fix_crash_snmpDonald Sharp2023-09-271-2/+3
|\ | | | | bgpd: fix crash in *bgpv2PeerErrorsTable"
| * bgpd: initialization in bgp_notify_admin_message functionFrancois Dumontet2023-09-191-0/+1
| | | | | | | | | | | | | | buffer buff is fully zeroed by a memset in bgp_notify_admin_message function Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
| * bgpd: fix crash in *bgpv2PeerErrorsTableFrancois Dumontet2023-09-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | following crash occurs: at ./nptl/pthread_kill.c:44 at ./nptl/pthread_kill.c:78 at ./nptl/pthread_kill.c:89 context=0x7ffd06d3d300) at /build/make-pkg/output/_packages/cp-routing/src/lib/sigevent.c:246 length=0x7ffd06d3da88, exact=1, var_len=0x7ffd06d3da90, write_method=<optimized out>) at /build/make-pkg/output/_packages/cp-routing/src/bgpd/bgp_snmp_bgp4v2.c:364 vp=vp@entry=0x7f7c88b584c0 <bgpv2_variables>, vp_len=vp_len@entry=102, ename=ename@entry=0x7f7c88b58440 <bgpv2_trap_oid>, enamelen=enamelen@entry=8, name=name@entry=0x7f7c88b58480 <bgpv2_oid>, namelen=namelen@entry=7, iname=0x7ffd06d3e7b0, index_len=1, trapobj=0x7f7c88b53b80 <bgpv2TrapBackListv6>, trapobjlen=6, sptrap=2 '\002') at /build/make-pkg/output/_packages/cp-routing/src/lib/agentx.c:382 vp_len=vp_len@entry=102, ename=ename@entry=0x7f7c88b58440 <bgpv2_trap_oid>, enamelen=enamelen@entry=8, name=name@entry=0x7f7c88b58480 <bgpv2_oid>, namelen=namelen@entry=7, iname=0x7ffd06d3ec30, inamelen=16, trapobj=0x7f7c88b53b80 <bgpv2TrapBackListv6>, trapobjlen=6, sptrap=2 '\002') at /build/make-pkg/output/_packages/cp-routing/src/lib/agentx.c:298 at /build/make-pkg/output/_packages/cp-routing/src/bgpd/bgp_snmp_bgp4v2.c:1496 at /build/make-pkg/output/_packages/cp-routing/src/bgpd/bgp_fsm.c:48 at /build/make-pkg/output/_packages/cp-routing/src/bgpd/bgp_fsm.c:1314 event=Receive_NOTIFICATION_message) at /build/make-pkg/output/_packages/cp-routing/src/bgpd/bgp_fsm.c:2665 at /build/make-pkg/output/_packages/cp-routing/src/bgpd/bgp_packet.c:3129 at /build/make-pkg/output/_packages/cp-routing/src/lib/event.c:1979 at /build/make-pkg/output/_packages/cp-routing/src/lib/libfrr.c:1213 at /build/make-pkg/output/_packages/cp-routing/src/bgpd/bgp_main.c:510 it's due to function bgpv2PeerErrorsTable returning return SNMP_STRING(msg_str); with msg_str NULL rather the string "" this commit avoid the issue. Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
* | bgpd: add linkstate debugLouis Scalbert2023-09-181-0/+2
|/ | | | | | | Add the "debug bgp linkstate" command to display incoming link-states prefixes. Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
* Merge pull request #12248 from pguibert6WIND/bgpasdotRuss White2023-02-211-3/+8
|\ | | | | lib, bgp: add initial support for asdot format
| * bgpd: support for as notation format for route distinguisherPhilippe Guibert2023-02-101-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RD may be built based on an AS number. Like for the AS, the RD may use the AS notation. The two below examples can illustrate: RD 1.1:20 stands for an AS4B:NN RD with AS4B=65536 in dot format. RD 0.1:20 stands for an AS2B:NNNN RD with AS2B=0.1 in dot+ format. This commit adds the asnotation mode to prefix_rd2str() API so as to pick up the relevant display. Two new printfrr extensions are available to display the RD with the two above display methods. - The pRDD extension stands for dot asnotation format - The pRDE extension stands for dot+ asnotation format. - The pRD extension has been renamed to pRDP extension The code is changed each time '%pRD' printf extension is called. Possibly, the asnotation may change the output, then a macro defines the asnotation mode to use. A side effect of forging the mode to use is that the string could not be concatenated with other strings in vty_out and snprintfrr. Those functions have been called multiple times. When zlog_debug needs to display the RD with some other string, the prefix_rd2str() old API is used instead of the printf extension. Some code has been kept untouched: - code related to running-config. Actually, wherever an RD is displayed, its configured name should be dumped. - bgp rfapi code - bgp evpn multihoming code (partially done), since the logic is missing to get the asnotation of 'struct bgp_evpn_es'. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* | Merge pull request #12780 from opensourcerouting/spdx-license-idDonald Sharp2023-02-171-16/+1
|\ \ | | | | | | *: convert to SPDX License identifiers
| * | *: auto-convert to SPDX License IDsDavid Lamparter2023-02-091-16/+1
| |/ | | | | | | | | | | Done with a combination of regex'ing and banging my head against a wall. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* / bgpd: Remove extraneous include of version.hDonald Sharp2023-02-101-1/+0
|/ | | | | | It's not needed in these compiles. So let's remove it. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* Revert "bgpd: optimal router reflection cli and fsm changes"Donatas Abraitis2023-01-171-43/+0
| | | | | | This reverts commit 70cd87ca02125616e9f61f97ab504248c935bd83. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
* Revert "bgpd: code review comments addressed"Donatas Abraitis2023-01-171-1/+1
| | | | This reverts commit 80f6ea8b99188b9d8e79fe4fc1740cc92375d7bc.
* bgpd: Deprecate some unused BGP stuffDonatas Abraitis2023-01-141-2/+0
| | | | | | | * BGP optional parameter type (Authentication) * BGP UPDATE message error subcode for AS loop Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
* bgpd: fix static analyzer warningsRafael Zalamena2022-12-201-77/+39
| | | | | | | | Use `DEFPY` to provide the `struct prefix` required by the debug insertion functions. While here exchange `int` with `bool` where appropriated. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* bgpd: When allocating prefix, free it when we are already tracking itDonald Sharp2022-12-201-51/+34
| | | | | | | | | | | | | | Several functions had this pattern: a) p = prefix_new b) if (already_tracking) return Let's just stop allocating the prefix and use a prefix on the stack, especially since the function used to hold the value actually copies it. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* bgpd: inet_ntop() adjustmentsDonatas Abraitis2022-11-291-9/+4
| | | | | | | Use %pI4/%pI6 where possible, otherwise at least atjust stack buffer sizes for inet_ntop() calls. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
* Merge pull request #12196 from opensourcerouting/xref-vtyshDonald Sharp2022-11-031-2/+0
|\ | | | | *: rewrite `extract.pl` using `xref` infra
| * build, vtysh: extract vtysh commands from .xrefDavid Lamparter2022-10-261-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rather than running selected source files through the preprocessor and a bunch of perl regex'ing to get the list of all DEFUNs, use the data collected in frr.xref. This not only eliminates issues we've been having with preprocessor failures due to nonexistent header files, but is also much faster. Where extract.pl would take 5s, this now finishes in 0.2s. And since this is a non-parallelizable build step towards the end of the build (dependent on a lot of other things being done already), the speedup is actually noticeable. Also files containing CLI no longer need to be listed in `vtysh_scan` since the .xref data covers everything. `#ifndef VTYSH_EXTRACT_PL` checks are equally obsolete. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* | bgpd: Implement Accumulated IGP Metric Attribute for BGPDonatas Abraitis2022-10-261-0/+5
|/ | | | | | https://www.rfc-editor.org/rfc/rfc7311.html Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
* bgpd: code review comments addressedMadhuri Kuruganti2022-10-121-1/+1
| | | | Signed-off-by: Madhuri Kuruganti <maduri111@gmail.com>
* bgpd: optimal router reflection cli and fsm changesMadhuri Kuruganti2022-10-121-0/+43
| | | | Signed-off-by: Madhuri Kuruganti <maduri111@gmail.com>
* *: Create and use infrastructure to show debugs in libDonald Sharp2022-10-071-0/+2
| | | | | | | | | There are lib debugs being set but never show up in `show debug` commands because there was no way to show that they were being used. Add a bit of infrastructure to allow this and then use it for `debug route-map` Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* bgpd: adding debug command for conditional advertisementMadhuri Kuruganti2022-10-061-0/+43
| | | | Signed-off-by: Madhuri Kuruganti <maduri111@gmail.com>
* bgpd: Use %pRD for prefix_rd2str()Donatas Abraitis2022-09-221-3/+1
| | | | | | Convert a bunch of prefix_rd2str() for json/vty stuff. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
* Merge pull request #11093 from donaldsharp/allow_martiansLou Berger2022-06-281-38/+0
|\ | | | | Allow martians
| * bgpd: Remove 'debug bgp allow-martian'Donald Sharp2022-06-241-38/+0
| | | | | | | | | | | | | | This command should not be in the code and is being removed as per tech meeting decision. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* | bgpd: Add RFC9234 implementationEugene Bogomazov2022-06-171-0/+1
|/ | | | | | | | | | | | | | | | | | | RFC9234 is a way to establish correct connection roles (Customer/ Provider, Peer or with RS) between bgp speakers. This patch: - Add a new configuration/terminal option to set the appropriate local role; - Add a mechanism for checking used roles, implemented by exchanging the corresponding capabilities in OPEN messages; - Add strict mode to force other party to use this feature; - Add basic support for a new transitive optional bgp attribute - OTC (Only to Customer); - Add logic for default setting OTC attribute and filtering routes with this attribute by the edge speakers, if the appropriate conditions are met; - Add two test stands to check role negotiation and route filtering during role usage. Signed-off-by: Eugene Bogomazov <eb@qrator.net>
* bgpd, ospfd: Remove extra newline for `show debugging`Donald Sharp2022-06-151-1/+0
| | | | | | | | This extra newline was adding a weird output to `show debugging` display where there would be extra newlines sometims and not others. Make it consistent. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* bgpd: Add Notification CEASE BFD Down messageDonatas Abraitis2022-06-021-0/+1
| | | | | | | | | | | | Related: https://datatracker.ietf.org/doc/html/draft-ietf-idr-bfd-subcode When BFD Down notification comes and BGP is configured to track on BFD events, send BGP Cease/BFD Down notification to the peer. If RFC 8538 is enabled (Notification support for Graceful-Restart), notification should be encapsulated into Hard Reset message. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
* bgpd: Make bgp_debug.[ch] take `const struct peer *` and return boolDonald Sharp2022-05-131-11/+11
| | | | | | | Several functions in bgp_debug.[ch] take a const struct peer * and also return a bool instead of an int. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* Merge pull request #11177 from opensourcerouting/fix/memset_memcpyDonald Sharp2022-05-131-3/+3
|\ | | | | *: memcpy/memset zeroing
| * *: Properly use memset() when zeroingDonatas Abraitis2022-05-111-3/+3
| | | | | | | | | | | | | | Wrong: memset(&a, 0, sizeof(struct ...)); Good: memset(&a, 0, sizeof(a)); Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
* | bgpd: Check and validate return value for str2ipaddr()Donatas Abraitis2022-05-121-3/+12
| | | | | | | | Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
* | bgpd: Check argv_find() value instead of the indexDonatas Abraitis2022-05-121-8/+8
|/ | | | Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
* bgpd: Implement CEASE/Hard Reset notificationDonatas Abraitis2022-05-021-3/+7
| | | | | | | | | | Also, add N-Bit (Notification) flag for Graceful Restart. This is a preparation for RFC8538. More information: https://datatracker.ietf.org/doc/html/rfc8538 Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
* bgpd: Allow setting BGP [large]community in route-mapsDonatas Abraitis2022-04-091-2/+4
| | | | | | | | | | | | | | | | | | | | | | Before: ``` spine1-debian-11(config-route-map)# bgp community alias 65001:65001 test1 spine1-debian-11(config)# route-map rm permit 10 spine1-debian-11(config-route-map)# set community 65001:65001 % Malformed communities attribute ``` After: ``` spine1-debian-11(config)# bgp community alias 65001:65001 test1 spine1-debian-11(config)# route-map rm permit 10 spine1-debian-11(config-route-map)# set community 65001:65001 spine1-debian-11(config-route-map)# ``` Same for large-communities. Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
* bgpd: Reuse get/set helpers for attr->communityDonatas Abraitis2022-02-251-1/+1
| | | | Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* bgpd: Use get/set helpers for attr->lcommunityDonatas Abraitis2022-02-101-1/+1
| | | | Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* bgpd: Use bgp_attr_[sg]et_ecommunity for struct ecommunityDonatas Abraitis2022-02-041-1/+2
| | | | | | This is an extra work before moving attr->ecommunity to attra_extra struct. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* bgpd: Increase administrative shutdown message size to 255Donatas Abraitis2022-01-071-1/+1
| | | | | | | | Extended BGP Administrative Shutdown Communication (rfc9003): Basically, shutdown message size is increased to 255 from 128. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* bgpd: Adjust symbolic names for cease notifications according to rfc4486Donatas Abraitis2022-01-061-5/+5
| | | | | | | | | | | | | | | | | | The following subcodes are defined for the Cease NOTIFICATION message: Subcode Symbolic Name 1 Maximum Number of Prefixes Reached 2 Administrative Shutdown 3 Peer De-configured 4 Administrative Reset 5 Connection Rejected 6 Other Configuration Change 7 Connection Collision Resolution 8 Out of Resources Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* bgpd: Generate and advertise gateway IP overlay index with EVPN RT-5Ameya Dharkar2021-06-081-2/+24
| | | | | | | | | | | | | | | Gateway IP overlay index is generated for EVPN RT-5 when following CLI is configured. router bgp 100 vrf vrf-blue address-family l2vpn evpn advertise ipv4 unicast gateway-ip advertise ipv6 unicast gateway-ip BGP nexthop of the VRF IP/IPv6 route is set as the gateway IP of the corresponding EVPN RT-5 Signed-off-by: Ameya Dharkar <adharkar@vmware.com>
* bgpd: fix enabling bfd debugIgor Ryzhov2021-06-011-2/+5
| | | | | | | When enabling bfd debug from the enable mode, library debugging is not enabled. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
* bgpd: add debug option for BFDRafael Zalamena2021-03-231-0/+41
| | | | | | Add new BGP debug option to enable BFD related debugging messages. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* Merge pull request #7247 from ton31337/feature/enhanced_route_refresh_capabilityRuss White2021-01-121-7/+5
|\ | | | | bgpd: Enhanced Route Refresh capability
| * bgpd: Implement enhanced route refresh capabilityDonatas Abraitis2021-01-051-7/+5
| | | | | | | | | | | | | | 16:40:49 BGP: 192.168.0.2: sending route-refresh (BoRR) for IPv4/unicast 16:40:51 BGP: 192.168.0.2: sending route-refresh (EoRR) for IPv4/unicast Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* | bgpd: Print large-community inside bgp_dump_attr()Donatas Abraitis2021-01-091-0/+6
|/ | | | | | Missing large communities. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* bgpd: Abstract attr->cluster to accessor/set functionsDonald Sharp2020-11-151-2/+5
| | | | | | | | | | Abstract the access of `attr->cluster` to appropriate accessor/set functionality. Future commits will allow us to move this data around to make `struct attr` smaller. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* bgpd: Add accessor for bgp_attr.pmsi_tnl_typeDonald Sharp2020-11-151-1/+1
| | | | | | | | | Add an accessor for the bgp_attr.pmsi_tnl_type to allow us to abstract where it is. Every attribute is paying the price of this bit of data as part of `struct bgp_attr` In the future we'll move it elsewhere. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
* bgpd: Correct CLI description for `debug bgp keepalives`Donatas Abraitis2020-11-071-2/+2
| | | | Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* :* Convert prefix2str to %pFXDonatas Abraitis2020-10-221-28/+14
| | | | Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>