diff options
author | Everton Marques <everton.marques@gmail.com> | 2009-11-18 10:44:13 -0200 |
---|---|---|
committer | Everton Marques <everton.marques@gmail.com> | 2009-11-18 10:44:13 -0200 |
commit | b5dfd4a6cc23896633cf8c9d7eb5ae2a811addb1 (patch) | |
tree | 76af33e919afe94d349ad73d345c86935b1c8ca6 /pimd/pim_pim.c | |
parent | a512d2ad9f6a1fd4e1bc29e5bbd47ff4cb052147 (diff) | |
download | quagga-b5dfd4a6cc23896633cf8c9d7eb5ae2a811addb1.tar.bz2 quagga-b5dfd4a6cc23896633cf8c9d7eb5ae2a811addb1.tar.xz |
[pim] Packet dump debugging
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; |