diff options
Diffstat (limited to 'pimd/pim_pim.c')
-rw-r--r-- | pimd/pim_pim.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/pimd/pim_pim.c b/pimd/pim_pim.c index 9b6dc359..9595d2d7 100644 --- a/pimd/pim_pim.c +++ b/pimd/pim_pim.c @@ -169,6 +169,10 @@ int pim_pim_packet(struct interface *ifp, char *buf, size_t len) pim_msg = buf + ip_hlen; pim_msg_len = len - ip_hlen; + if (PIM_DEBUG_PIM_PACKETDUMP_RECV) { + pim_pkt_dump(__PRETTY_FUNCTION__, pim_msg, pim_msg_len); + } + if (pim_msg_len < PIM_PIM_MIN_LEN) { zlog_warn("PIM message size=%d shorter than minimum=%d", pim_msg_len, PIM_PIM_MIN_LEN); @@ -289,6 +293,10 @@ static int pim_sock_read(struct thread *t) len, from_str, to_str, fd, ifindex, ifp->ifindex); } + if (PIM_DEBUG_PIM_PACKETDUMP_RECV) { + pim_pkt_dump(__PRETTY_FUNCTION__, buf, len); + } + #ifdef PIM_CHECK_RECV_IFINDEX_SANITY /* ifindex sanity check */ if (ifindex != (int) ifp->ifindex) { @@ -456,6 +464,10 @@ int pim_msg_send(int fd, #endif tolen = sizeof(to); + if (PIM_DEBUG_PIM_PACKETDUMP_SEND) { + pim_pkt_dump(__PRETTY_FUNCTION__, pim_msg, pim_msg_size); + } + sent = sendto(fd, pim_msg, pim_msg_size, MSG_DONTWAIT, &to, tolen); if (sent != (ssize_t) pim_msg_size) { int e = errno; |