Go to file
Loïc Sang e0ae285eb8 bgpd: avoid clearing routes for peers that were never established
Under heavy system load with many peers in passive mode and a large
number of routes, bgpd can enter an infinite loop. This occurs while
processing timeout BGP_OPEN messages, which prevents it from accepting
new connections. The following log entries illustrate the issue:
>bgpd[6151]: [VX6SM-8YE5W][EC 33554460] 3.3.2.224: nexthop_set failed, resetting connection - intf 0x0
>bgpd[6151]: [P790V-THJKS][EC 100663299] bgp_open_receive: bgp_getsockname() failed for peer: 3.3.2.224
>bgpd[6151]: [HTQD2-0R1WR][EC 33554451] bgp_process_packet: BGP OPEN receipt failed for peer: 3.3.2.224
... repeating

The issue occurs when bgpd handles a massive number of routes in the RIB
while receiving numerous BGP_OPEN packets. If bgpd is overloaded, it
fails to process these packets promptly, leading the remote peer to
close the connection and resend BGP_OPEN packets.

When bgpd eventually starts processing these timeout BGP_OPEN packets,
it finds the TCP connection closed by the remote peer, resulting in
"bgp_stop()" being called. For each timeout peer, bgpd must iterate
through the routing table, which is time-consuming and causes new
incoming BGP_OPEN packets to timeout, perpetuating the infinite loop.

To address this issue, the code is modified to check if the peer has
been established at least once before calling "bgp_clear_route_all()".
This ensures that routes are only cleared for peers that had a
successful session, preventing unnecessary iterations over the routing
table for peers that never established a connection.

With this change, BGP_OPEN timeout messages may still occur, but in the
worst case, bgpd will stabilize. Before this patch, bgpd could enter a
loop where it was unable to accpet any new connections.

Signed-off-by: Loïc Sang <loic.sang@6wind.com>
2024-06-26 16:11:16 +02:00
.github ci: do apt-get update before installing required modules 2024-06-08 17:29:19 -04:00
alpine docker: Fix post function for Alpine build (package) 2024-03-09 09:33:40 +02:00
babeld babeld: changes for code maintainability 2024-02-20 00:25:27 +05:30
bfdd bfdd: fix BFD_GETCBIT 2024-04-15 01:57:16 +03:00
bgpd bgpd: avoid clearing routes for peers that were never established 2024-06-26 16:11:16 +02:00
debian debian: libyang3 2024-05-08 01:48:06 +02:00
doc doc: Document the usage of --enable-undefined-sanitizer 2024-06-19 08:01:16 -04:00
docker Merge pull request #16143 from eremcan/patch-1 2024-06-07 10:49:55 +03:00
eigrpd *: Modify agentx to be allowed to be called 2024-05-10 10:16:29 -04:00
fpm *: add XREF_SETUP() to libraries and utilites 2024-05-02 23:03:08 +02:00
gdb lib: add simplified native msg support 2023-12-26 08:34:56 -05:00
grpc build: throw in a few more XREF_SETUP 2024-05-09 18:02:49 +02:00
include build: include our own copy of if.h and dependencies 2024-04-26 17:11:53 +02:00
isisd Merge pull request #16230 from zhou-run/202406171103 2024-06-18 11:20:13 -04:00
ldpd *: Modify agentx to be allowed to be called 2024-05-10 10:16:29 -04:00
lib Merge pull request #16237 from pguibert6WIND/json_ttable_caml_format 2024-06-18 15:26:00 -04:00
m4 build: add recursion limit for AX_RECURSIVE_EVAL 2024-01-27 19:01:19 +01:00
mgmtd Merge pull request #16184 from LabNConsulting/chopps/fe-notify-select 2024-06-13 00:20:09 -05:00
mlag build: throw in a few more XREF_SETUP 2024-05-09 18:02:49 +02:00
nhrpd nhrpd: add cisco-authentication password support 2024-06-10 16:39:21 -07:00
ospf6d Merge pull request #16050 from rgirada/ospfv3_helper 2024-06-11 11:48:05 -04:00
ospfclient *: Convert event.h to frrevent.h 2023-03-24 08:32:17 -04:00
ospfd ospfd: Fix memory leak after cleaning cleaning up interfaceIp JSON field 2024-06-12 16:28:38 +03:00
pathd pathd: clean up a log message 2024-04-30 14:34:58 -04:00
pbrd *: create a single registry of daemons' default port values 2024-02-01 11:40:02 -05:00
pceplib Merge pull request #15215 from donaldsharp/pceplib_fixup 2024-01-25 09:59:59 +02:00
pimd pimd: Give a clearer warning when the kernel is not compiled right 2024-05-31 11:29:40 -04:00
pkgsrc build: homologize path handling 2024-01-27 19:02:52 +01:00
python Merge pull request #15980 from donaldsharp/agentx_update 2024-05-20 22:33:01 +03:00
qpb *: add XREF_SETUP() to libraries and utilites 2024-05-02 23:03:08 +02:00
redhat debian, redhat, snapcraft: Libyang min version is 2.1.128 2024-04-16 13:45:12 +02:00
ripd *: Modify agentx to be allowed to be called 2024-05-10 10:16:29 -04:00
ripngd ripngd: convert RPC commands to mgmtd 2024-04-22 16:36:23 +03:00
sharpd zebra, sharpd: add srv6 End.DX6 support 2024-04-25 13:54:25 +02:00
snapcraft debian, redhat, snapcraft: Libyang min version is 2.1.128 2024-04-16 13:45:12 +02:00
staticd Merge pull request #15285 from idryzhov/staticd-nexthop-refcounter 2024-02-08 15:53:30 -05:00
tests Merge pull request #16227 from y-bharath14/srib-topotest-e 2024-06-18 15:52:38 -04:00
tools tools/gcc-plugins: warn for suseconds_t format 2024-05-02 22:26:53 +02:00
vrrpd *: create a single registry of daemons' default port values 2024-02-01 11:40:02 -05:00
vtysh vtysh: CLI to override default SID format config 2024-06-13 14:54:16 +02:00
watchfrr build: homologize path handling 2024-01-27 19:02:52 +01:00
yang yang: fix wrong check for isis metric style 2024-06-11 17:16:46 +08:00
zebra zebra: fix evpn mh bond member proto reinstall 2024-06-20 09:09:21 -07:00
.clang-format build: make clang-format ignore DEFUN/DEFPY 2024-05-08 21:47:14 +02:00
.dockerignore docker: Make docker image on CentOS 7 2019-11-26 19:29:30 +00:00
.flake8 style: add format checker config that matches FRR style standards 2023-04-18 05:18:26 -04:00
.git-blame-ignore-revs tools: Add black formatting commit to .git-blame-ignore-revs 2024-04-28 12:50:51 +03:00
.gitignore python: add tool to expand typesafe definitions 2024-04-29 17:37:49 +02:00
.isort.cfg style: add format checker config that matches FRR style standards 2023-04-18 05:18:26 -04:00
.pylintrc style: add format checker config that matches FRR style standards 2023-04-18 05:18:26 -04:00
.travis.yml lib: libyang2 add missed conversion 2021-05-17 22:13:59 -04:00
bootstrap.sh build: turn on automake warnings (& symlinks) 2021-04-21 15:42:37 +02:00
buildtest.sh build: update packaging & docs for dir changes 2024-01-27 19:01:19 +01:00
config.version.in build: carry --with-pkg-extra-version into tarballs 2018-10-24 15:11:50 +02:00
configure.ac build: FRR 10.2 development version 2024-06-12 12:03:21 -05:00
COPYING *: sort out & explain licenses used in FRR 2023-02-09 12:46:13 +01:00
Makefile.am build: homologize path handling 2024-01-27 19:02:52 +01:00
README.md doc: Fix the link that points to Slack invitation in README 2022-03-24 13:13:37 +02:00
stamp-h.in Initial revision 2002-12-13 20:15:29 +00:00
version.h build: make builddir include path consistent 2021-04-21 15:42:33 +02:00

Icon

FRRouting

FRR is free software that implements and manages various IPv4 and IPv6 routing protocols. It runs on nearly all distributions of Linux and BSD and supports all modern CPU architectures.

FRR currently supports the following protocols:

  • BGP
  • OSPFv2
  • OSPFv3
  • RIPv1
  • RIPv2
  • RIPng
  • IS-IS
  • PIM-SM/MSDP
  • LDP
  • BFD
  • Babel
  • PBR
  • OpenFabric
  • VRRP
  • EIGRP (alpha)
  • NHRP (alpha)

Installation & Use

For source tarballs, see the releases page.

For Debian and its derivatives, use the APT repository at https://deb.frrouting.org/.

Instructions on building and installing from source for supported platforms may be found in the developer docs.

Once installed, please refer to the user guide for instructions on use.

Community

The FRRouting email list server is located here and offers the following public lists:

Topic List
Development dev@lists.frrouting.org
Users & Operators frog@lists.frrouting.org
Announcements announce@lists.frrouting.org

For chat, we currently use Slack. You can join by clicking the "Slack" link under the Participate section of our website.

Contributing

FRR maintains developer's documentation which contains the project workflow and expectations for contributors. Some technical documentation on project internals is also available.

We welcome and appreciate all contributions, no matter how small!

Security

To report security issues, please use our security mailing list:

security [at] lists.frrouting.org