]> git.proxmox.com Git - mirror_frr.git/blobdiff - pimd/pim_pim.c
Merge pull request #5767 from ton31337/fix/replace_s_addr_0_to_INADDR_ANY
[mirror_frr.git] / pimd / pim_pim.c
index cd2d306f3db2e52b931e953a3ff1dd38e8edd2a8..342c0a74e049fd3554ffbff5eb424d4a8a8dda56 100644 (file)
@@ -190,6 +190,12 @@ int pim_pim_packet(struct interface *ifp, uint8_t *buf, size_t len)
        no_fwd = header->Nbit;
 
        if (header->type == PIM_MSG_TYPE_REGISTER) {
+               if (pim_msg_len < PIM_MSG_REGISTER_LEN) {
+                       if (PIM_DEBUG_PIM_PACKETS)
+                               zlog_debug("PIM Register Message size=%d shorther than min length %d",
+                                          pim_msg_len, PIM_MSG_REGISTER_LEN);
+                       return -1;
+               }
                /* First 8 byte header checksum */
                checksum = in_cksum(pim_msg, PIM_MSG_REGISTER_LEN);
                if (checksum != pim_checksum) {