mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-02 18:52:04 +00:00
Merge pull request #14312 from FRRouting/mergify/bp/stable/8.5/pr-14302
pimd: When receiving a packet be more careful with length in pim_pim_… (backport #14302)
This commit is contained in:
commit
51254d4ae3
@ -168,7 +168,7 @@ int pim_pim_packet(struct interface *ifp, uint8_t *buf, size_t len,
|
||||
bool no_fwd;
|
||||
|
||||
#if PIM_IPV == 4
|
||||
if (len < sizeof(*ip_hdr)) {
|
||||
if (len <= sizeof(*ip_hdr)) {
|
||||
if (PIM_DEBUG_PIM_PACKETS)
|
||||
zlog_debug(
|
||||
"PIM packet size=%zu shorter than minimum=%zu",
|
||||
@ -202,7 +202,6 @@ int pim_pim_packet(struct interface *ifp, uint8_t *buf, size_t len,
|
||||
iovp->iov_len = pim_msg_len;
|
||||
iovp++;
|
||||
|
||||
header = (struct pim_msg_header *)pim_msg;
|
||||
if (pim_msg_len < PIM_PIM_MIN_LEN) {
|
||||
if (PIM_DEBUG_PIM_PACKETS)
|
||||
zlog_debug(
|
||||
@ -210,6 +209,7 @@ int pim_pim_packet(struct interface *ifp, uint8_t *buf, size_t len,
|
||||
pim_msg_len, PIM_PIM_MIN_LEN);
|
||||
return -1;
|
||||
}
|
||||
header = (struct pim_msg_header *)pim_msg;
|
||||
|
||||
if (header->ver != PIM_PROTO_VERSION) {
|
||||
if (PIM_DEBUG_PIM_PACKETS)
|
||||
|
Loading…
Reference in New Issue
Block a user