]> git.proxmox.com 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>
Sat, 4 Jan 2020 03:33:52 +0000 (22:33 -0500)
commitab12ca856cc7acfe7ccaa0849919181f53a3dc32
tree3838795277313d17741979de25211494dc8f4de6
parentb833cc1ff473e5de43a6c33b520024c943db180c
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