summaryrefslogtreecommitdiffstats
path: root/pimd/pim_pim.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2016-12-07 14:18:09 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2016-12-22 02:26:18 +0100
commit67f771b3a32deac5de2fed20da6317b9ccf2ed80 (patch)
tree0c001ccabc97ba6aaf2511434018eabb76d65c42 /pimd/pim_pim.c
parentpimd: Modify pim_upstream_new behavior (diff)
downloadfrr-67f771b3a32deac5de2fed20da6317b9ccf2ed80.tar.xz
frr-67f771b3a32deac5de2fed20da6317b9ccf2ed80.zip
pimd: Add guard for pim_msg_send_frame
In certain error conditions it is possible to attempt to send packets when the socket is not ready instead of dumping to the log a million error messages only note the issue if we have packet debugs on. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_pim.c')
-rw-r--r--pimd/pim_pim.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/pimd/pim_pim.c b/pimd/pim_pim.c
index b77f39f1c..b973adacc 100644
--- a/pimd/pim_pim.c
+++ b/pimd/pim_pim.c
@@ -506,11 +506,14 @@ pim_msg_send_frame (int fd, char *buf, size_t len,
return -1;
break;
default:
- pim_inet4_dump ("<dst?>", ip->ip_dst, dst_str, sizeof (dst_str));
- zlog_warn ("%s: sendto() failure to %s: fd=%d msg_size=%zd: errno=%d: %s",
- __PRETTY_FUNCTION__,
- dst_str, fd, len,
- errno, safe_strerror(errno));
+ if (PIM_DEBUG_PIM_PACKETS)
+ {
+ pim_inet4_dump ("<dst?>", ip->ip_dst, dst_str, sizeof (dst_str));
+ zlog_warn ("%s: sendto() failure to %s: fd=%d msg_size=%zd: errno=%d: %s",
+ __PRETTY_FUNCTION__,
+ dst_str, fd, len,
+ errno, safe_strerror(errno));
+ }
return -1;
break;
}