mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-13 19:02:58 +00:00
pimd: Cleanup handling of pim_sock_read
Cleanup some turned on debug code that is no longer needed to be turned on in the pim_sock_read code path. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
70989c7c20
commit
9d8b5695fe
@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
PIM_DEFS =
|
PIM_DEFS =
|
||||||
#PIM_DEFS += -DPIM_DEBUG_BYDEFAULT
|
#PIM_DEFS += -DPIM_DEBUG_BYDEFAULT
|
||||||
PIM_DEFS += -DPIM_CHECK_RECV_IFINDEX_SANITY
|
#PIM_DEFS += -DPIM_CHECK_RECV_IFINDEX_SANITY
|
||||||
#PIM_DEFS += -DPIM_REPORT_RECV_IFINDEX_MISMATCH
|
#PIM_DEFS += -DPIM_REPORT_RECV_IFINDEX_MISMATCH
|
||||||
PIM_DEFS += -DPIM_ZCLIENT_DEBUG
|
PIM_DEFS += -DPIM_ZCLIENT_DEBUG
|
||||||
PIM_DEFS += -DPIM_ENFORCE_LOOPFREE_MFC
|
PIM_DEFS += -DPIM_ENFORCE_LOOPFREE_MFC
|
||||||
|
@ -142,13 +142,6 @@ int pim_pim_packet(struct interface *ifp, uint8_t *buf, size_t len)
|
|||||||
uint16_t checksum; /* computed checksum */
|
uint16_t checksum; /* computed checksum */
|
||||||
struct pim_neighbor *neigh;
|
struct pim_neighbor *neigh;
|
||||||
|
|
||||||
if (!ifp->info) {
|
|
||||||
if (PIM_DEBUG_PIM_PACKETS)
|
|
||||||
zlog_debug("%s: PIM not enabled on interface %s",
|
|
||||||
__PRETTY_FUNCTION__, ifp->name);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (len < sizeof(*ip_hdr)) {
|
if (len < sizeof(*ip_hdr)) {
|
||||||
if (PIM_DEBUG_PIM_PACKETS)
|
if (PIM_DEBUG_PIM_PACKETS)
|
||||||
zlog_debug("PIM packet size=%zu shorter than minimum=%zu",
|
zlog_debug("PIM packet size=%zu shorter than minimum=%zu",
|
||||||
@ -158,8 +151,11 @@ int pim_pim_packet(struct interface *ifp, uint8_t *buf, size_t len)
|
|||||||
|
|
||||||
ip_hdr = (struct ip *) buf;
|
ip_hdr = (struct ip *) buf;
|
||||||
|
|
||||||
|
if (PIM_DEBUG_PIM_PACKETS)
|
||||||
|
{
|
||||||
pim_inet4_dump("<src?>", ip_hdr->ip_src, src_str, sizeof(src_str));
|
pim_inet4_dump("<src?>", ip_hdr->ip_src, src_str, sizeof(src_str));
|
||||||
pim_inet4_dump("<dst?>", ip_hdr->ip_dst, dst_str, sizeof(dst_str));
|
pim_inet4_dump("<dst?>", ip_hdr->ip_dst, dst_str, sizeof(dst_str));
|
||||||
|
}
|
||||||
|
|
||||||
ip_hlen = ip_hdr->ip_hl << 2; /* ip_hl gives length in 4-byte words */
|
ip_hlen = ip_hdr->ip_hl << 2; /* ip_hl gives length in 4-byte words */
|
||||||
|
|
||||||
@ -308,19 +304,11 @@ static int pim_sock_read(struct thread *t)
|
|||||||
fd = THREAD_FD(t);
|
fd = THREAD_FD(t);
|
||||||
|
|
||||||
pim_ifp = ifp->info;
|
pim_ifp = ifp->info;
|
||||||
zassert(pim_ifp);
|
|
||||||
|
|
||||||
zassert(fd == pim_ifp->pim_sock_fd);
|
|
||||||
|
|
||||||
len = pim_socket_recvfromto(fd, buf, sizeof(buf),
|
len = pim_socket_recvfromto(fd, buf, sizeof(buf),
|
||||||
&from, &fromlen,
|
&from, &fromlen,
|
||||||
&to, &tolen,
|
&to, &tolen,
|
||||||
&ifindex);
|
&ifindex);
|
||||||
if (len < 0) {
|
|
||||||
zlog_warn("Failure receiving IP PIM packet on fd=%d: errno=%d: %s",
|
|
||||||
fd, errno, safe_strerror(errno));
|
|
||||||
goto done;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (PIM_DEBUG_PIM_PACKETS) {
|
if (PIM_DEBUG_PIM_PACKETS) {
|
||||||
char from_str[INET_ADDRSTRLEN];
|
char from_str[INET_ADDRSTRLEN];
|
||||||
@ -333,11 +321,11 @@ static int pim_sock_read(struct thread *t)
|
|||||||
|
|
||||||
zlog_debug("Recv IP PIM pkt size=%d from %s to %s on fd=%d on ifindex=%d (sock_ifindex=%d)",
|
zlog_debug("Recv IP PIM pkt size=%d from %s to %s on fd=%d on ifindex=%d (sock_ifindex=%d)",
|
||||||
len, from_str, to_str, fd, ifindex, ifp->ifindex);
|
len, from_str, to_str, fd, ifindex, ifp->ifindex);
|
||||||
}
|
|
||||||
|
|
||||||
if (PIM_DEBUG_PIM_PACKETDUMP_RECV) {
|
if (PIM_DEBUG_PIM_PACKETDUMP_RECV) {
|
||||||
pim_pkt_dump(__PRETTY_FUNCTION__, buf, len);
|
pim_pkt_dump(__PRETTY_FUNCTION__, buf, len);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef PIM_CHECK_RECV_IFINDEX_SANITY
|
#ifdef PIM_CHECK_RECV_IFINDEX_SANITY
|
||||||
/* ifindex sanity check */
|
/* ifindex sanity check */
|
||||||
|
Loading…
Reference in New Issue
Block a user