Go to file
Quentin Young 7a86aa5a0a
bgpd: schedule packet job after connection xfer
During initial session establishment, bgpd performs a "connection
transfer" to a new peer struct if the connection was initiated passively
(i.e. by the remote peer). With the addition of buffered input and a
reorganized packet processor, the following race condition manifests:

1. Remote peer initiates a connection. After exchanging OPEN messages,
   we send them a KEEPALIVE. They send us a KEEPALIVE followed by
   10,000 UPDATE messages. The I/O thread pushes these onto our local
   peer's input buffer and schedules a packet processing job on the
   main thread.
2. The packet job runs and processes the KEEPALIVE, which completes the
   handshake on our end. As part of transferring to ESTABLISHED we
   transfer all peer state to a new struct, as mentioned. Upon returning
   from the KEEPALIVE processing routing, the peer context we had has
   now been destroyed. We notice this and stop processing. Meanwhile
   10k UPDATE messages are sitting on the input buffer.
3. N seconds later, the remote peer sends us a KEEPALIVE. The I/O thread
   schedules another process job, which finds 10k UPDATEs waiting for
   it. Convergence is achieved, but has been delayed by the value of the
   KEEPALIVE timer.

The racey part is that if the remote peer takes a little bit of time to
send UPDATEs after KEEPALIVEs -- somewhere on the order of a few hundred
milliseconds -- we complete the transfer successfully and the packet
processing job is scheduled on the new peer upon arrival of the UPDATE
messages. Yuck.

The solution is to schedule a packet processing job on the new peer
struct after transferring state.

Lengthy commit message in case someone has to debug similar problems in
the future...

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-11-30 16:18:05 -05:00
babeld *: Make zapi route install Notifications optional 2017-11-27 09:09:35 -05:00
bgpd bgpd: schedule packet job after connection xfer 2017-11-30 16:18:05 -05:00
debianpkg debianpkg: Update lintian-overrides 2017-11-17 17:55:34 -08:00
doc Merge pull request #1387 from donaldsharp/save_zserv_incoming 2017-11-21 09:06:06 -02:00
eigrpd eigrpd: Start conversion to use route install failure callback 2017-11-27 09:09:36 -05:00
fpm build: clean up BUILT_SOURCES 2017-08-04 11:13:55 +02:00
gdb gdb: Add a directory of files with gdb macros 2016-05-26 15:33:30 +00:00
include build: include our own copies of some linux kernel headers 2017-10-24 09:20:12 -02:00
init build: delete .cvsignore files 2011-12-13 14:27:01 +04:00
isisd *: Make zapi route install Notifications optional 2017-11-27 09:09:35 -05:00
ldpd *: Make zapi route install Notifications optional 2017-11-27 09:09:35 -05:00
lib bgpd: implement buffered reads 2017-11-30 16:17:59 -05:00
m4 build: non-recursive auxiliary directories 2017-07-31 23:03:30 +02:00
nhrpd *: Make zapi route install Notifications optional 2017-11-27 09:09:35 -05:00
ospf6d Merge pull request #1464 from chiragshah6/mdev 2017-11-29 07:37:58 -05:00
ospfclient Merge pull request #911 from opensourcerouting/non-recursive-2 2017-08-09 14:38:07 -04:00
ospfd Merge pull request #1484 from chiragshah6/ospfv3_dev 2017-11-29 07:45:04 -05:00
pimd *: Make zapi route install Notifications optional 2017-11-27 09:09:35 -05:00
pkgsrc build: non-recursive auxiliary directories 2017-07-31 23:03:30 +02:00
ports pimd: merge pimd as of 2015-01-19 2016-05-25 20:38:32 -04:00
python zebra: unify the ipv4/ipv6 'show ip route' commands - part 1/2 2017-10-24 10:12:40 -02:00
qpb build: clean up BUILT_SOURCES 2017-08-04 11:13:55 +02:00
redhat sharpd: Add Super Happy Advanced Routing Protocol 2017-11-27 09:16:30 -05:00
ripd *: Make zapi route install Notifications optional 2017-11-27 09:09:35 -05:00
ripngd *: Make zapi route install Notifications optional 2017-11-27 09:09:35 -05:00
sharpd sharpd: Add Super Happy Advanced Routing Protocol 2017-11-27 09:16:30 -05:00
snapcraft build: non-recursive auxiliary directories 2017-07-31 23:03:30 +02:00
solaris gitignore: update references to FRR 2017-07-12 11:55:04 -05:00
tests tests: add name to test_mp_attr threadmaster 2017-11-30 16:18:05 -05:00
tools sharpd: Add Super Happy Advanced Routing Protocol 2017-11-27 09:16:30 -05:00
vtysh Merge pull request #1445 from donaldsharp/rpki_vtysh 2017-11-28 14:44:39 -02:00
watchfrr *: watchfrr needs 'show debugging' DEFUN 2017-09-20 19:34:50 +04:00
zebra Merge pull request #1476 from qlyoung/null0-hack 2017-11-29 07:49:04 -05:00
.clang-format *: use the FOR_ALL_INTERFACES abstraction from babeld 2017-10-10 09:05:46 -03:00
.dir-locals.el .dir-locals.el: show trailing whitespace 2017-11-07 12:05:09 -05:00
.gitignore debian/backports: include in distfile, don't put files in .. 2017-11-17 17:55:29 -08:00
AUTHORS Initial revision 2002-12-13 20:15:29 +00:00
bootstrap.sh autoreconf -i 2007-02-06 19:28:28 +00:00
buildtest.sh config: switch a few references to say FRR 2017-07-12 11:25:33 -05:00
ChangeLog Rename: freerangerouting --> frrouting 2017-03-30 14:24:05 -04:00
common.am python/clippy: make output file writing less weird 2017-08-24 00:18:53 +02:00
COMMUNITY.md *: repaired internal link to dev guide 2017-11-15 16:39:19 +01:00
configure.ac sharpd: Add Super Happy Advanced Routing Protocol 2017-11-27 09:16:30 -05:00
COPYING *: make consistent & update GPLv2 file headers 2017-05-15 16:37:41 +02:00
COPYING-LGPLv2.1 build: remove LGPL v2.0, add LGPL v2.1 2016-11-15 17:19:38 +09:00
defaults.h *: reindent 2017-07-17 14:04:07 +02:00
git-reindent-branch.py *: update git-reindent-branch.py 2017-08-22 18:51:31 +02:00
indent.py *: add indent control files 2017-07-17 14:00:23 +02:00
Makefile.am sharpd: Add Super Happy Advanced Routing Protocol 2017-11-27 09:16:30 -05:00
NEWS release: 0.99.24 2016-06-03 15:56:44 -04:00
README README: add references to EIGRP and NHRP. 2017-05-12 22:51:45 +02:00
README.NetBSD config: switch a few references to say FRR 2017-07-12 11:25:33 -05:00
render_md.py build: number sections in COMMUNITY.md HTML 2016-12-05 19:08:00 +01:00
REPORTING-BUGS config: switch a few references to say FRR 2017-07-12 11:25:33 -05:00
SERVICES babeld/eigrpd: flip VTY ports & fix rpm 2017-06-13 14:36:55 +02:00
stamp-h.in Initial revision 2002-12-13 20:15:29 +00:00
update-autotools * README.NetBSD: use update-autotools instead of autoreconf 2007-02-02 16:52:38 +00:00

FRRouting is free software that manages various IPv4 and IPv6 routing
protocols.

Currently FRRouting supports BGP4, BGP4+, OSPFv2, OSPFv3, RIPv1,
RIPv2, RIPng, PIM-SM/MSDP and LDP as well as very early support for IS-IS,
EIGRP and NHRP.

See the file REPORTING-BUGS to report bugs.

Free RRRouting is free software. See the file COPYING for copying conditions.

Public email discussion can be found at https://lists.frrouting.org/listinfo

Our public slack channel is at https://frrouting.slack.com