]> git.puffer.fish Git - matthieu/frr.git/commitdiff
pimd: Add guard for pim_msg_send_frame
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 7 Dec 2016 13:18:09 +0000 (08:18 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 22 Dec 2016 01:26:18 +0000 (20:26 -0500)
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>
pimd/pim_pim.c

index b77f39f1c46dc7600d7b1fcb42730cafe01544ae..b973adacc424757823dca7207d80f40bc2321bb3 100644 (file)
@@ -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;
        }