]> git.puffer.fish Git - mirror/frr.git/commit
zebra: fix multiple bfd buffer issues
authorQuentin Young <qlyoung@cumulusnetworks.com>
Sat, 4 Jan 2020 02:18:49 +0000 (21:18 -0500)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Wed, 15 Jan 2020 17:50:12 +0000 (12:50 -0500)
commita4f1cc55843b5596044ab691c2fd21104afa9e7f
tree601b3d668169d01eb860345594782602a6d1aad7
parentb03575db49a43e070efd41fefba37bde24195610
zebra: fix multiple bfd buffer issues

Whatever this BFD re-transmission function is had a few problems.

1. Used memcpy instead of the (more concise) stream APIs, which include
   bounds checking.
2. Did not sufficiently check packet sizes.

Actually, 2) is mitigated but is still a problem, because the BFD header
is 2 bytes larger than the "normal" ZAPI header, while the overall
message size remains the same. So if the source message being duplicated
is actually right up against the ZAPI_MAX_PACKET_SIZ, you still can't
fit the whole message into your duplicated message. I have no idea what
the intent was here but at least there's a warning if it happens now.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
zebra/zebra_ptm.c