mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-15 04:47:05 +00:00
pimd: fix negative bitshift
Valid range for hashmasklen is 0-32 under IPv4; failure to validate this results in a negative bitshift later Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
This commit is contained in:
parent
70ecc066e7
commit
817f893343
@ -1282,6 +1282,13 @@ int pim_bsm_process(struct interface *ifp, struct ip *ip_hdr, uint8_t *buf,
|
|||||||
bshdr = (struct bsm_hdr *)(buf + PIM_MSG_HEADER_LEN);
|
bshdr = (struct bsm_hdr *)(buf + PIM_MSG_HEADER_LEN);
|
||||||
pim_inet4_dump("<bsr?>", bshdr->bsr_addr.addr, bsr_str,
|
pim_inet4_dump("<bsr?>", bshdr->bsr_addr.addr, bsr_str,
|
||||||
sizeof(bsr_str));
|
sizeof(bsr_str));
|
||||||
|
if (bshdr->hm_len > 32) {
|
||||||
|
zlog_warn("Bad hashmask length for IPv4; got %" PRIu8
|
||||||
|
", expected value in range 0-32",
|
||||||
|
bshdr->hm_len);
|
||||||
|
pim->bsm_dropped++;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
pim->global_scope.hashMasklen = bshdr->hm_len;
|
pim->global_scope.hashMasklen = bshdr->hm_len;
|
||||||
frag_tag = ntohs(bshdr->frag_tag);
|
frag_tag = ntohs(bshdr->frag_tag);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user