From: Donald Sharp Date: Wed, 8 Jun 2016 15:47:33 +0000 (-0400) Subject: pimd: Fix register message checksum X-Git-Tag: frr-2.0-rc1~585 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=f5e6574b65165091b8b6ae101a2ab421598f1409;p=matthieu%2Ffrr.git pimd: Fix register message checksum The register message checksum was being calculated over the first 4 bytes of the packet, instead of the first 8 bytes. From the RFC: PIM Version, Type, Reserved, Checksum Described in Section 4.9. Note that in order to reduce encapsulation overhead, the checksum for Registers is done only on the first 8 bytes of the packet, including the PIM header and the next 4 bytes, excluding the data packet portion. For interoperability reasons, a message carrying a checksum calculated over the entire PIM Register message should also be accepted. When calculating the checksum, the IPv6 pseudoheader "Upper-Layer Packet Length" is set to 8. Ticket: CM-11265 Signed-off-by: Donald Sharp --- diff --git a/pimd/pim_register.c b/pimd/pim_register.c index 406f91494a..2d0de586d7 100644 --- a/pimd/pim_register.c +++ b/pimd/pim_register.c @@ -88,7 +88,7 @@ pim_register_send (const struct ip *ip_hdr, struct pim_rpf *rpg) plen = ntohs(ip_hdr->ip_len); memcpy(b1, (const unsigned char *)ip_hdr, plen); - pim_msg_build_header(buffer, plen + PIM_MSG_HEADER_LEN, PIM_MSG_TYPE_REGISTER); + pim_msg_build_header(buffer, plen + PIM_MSG_REGISTER_LEN, PIM_MSG_TYPE_REGISTER); if (pim_msg_send(pinfo->pim_sock_fd, rpg->rpf_addr,