pimd: fix bsm buflen check to include pim hdr

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
This commit is contained in:
Quentin Young 2019-11-19 21:47:40 -05:00
parent b1945363fb
commit d83a854b5b

View File

@ -1267,7 +1267,7 @@ int pim_bsm_process(struct interface *ifp, struct ip *ip_hdr, uint8_t *buf,
return -1;
}
if (buf_size < sizeof(struct bsm_hdr)) {
if (buf_size < (PIM_MSG_HEADER_LEN + sizeof(struct bsm_hdr))) {
if (PIM_DEBUG_BSM)
zlog_debug("%s: received buffer length of %d which is too small to properly decode",
__PRETTY_FUNCTION__, buf_size);