From: Donald Sharp Date: Tue, 9 Aug 2016 18:25:12 +0000 (-0400) Subject: pimd: Remove some impossible error conditions. X-Git-Tag: frr-3.0-branchpoint~64^2~10^2~299 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=f0ce50d470379a2fafaaa20243345bc084c1ad2d;p=mirror%2Ffrr.git pimd: Remove some impossible error conditions. It is impossible that we can hit these error conditions. Remove them from the code. Signed-off-by: Donald Sharp --- diff --git a/pimd/pim_mroute.c b/pimd/pim_mroute.c index ab07cb6792..f6808feb49 100644 --- a/pimd/pim_mroute.c +++ b/pimd/pim_mroute.c @@ -435,27 +435,14 @@ int pim_mroute_msg(int fd, const char *buf, int buf_size) static int mroute_read_msg(int fd) { - const int msg_min_size = MAX(sizeof(struct ip), sizeof(struct igmpmsg)); - char buf[1000]; + char buf[2000]; int rd; - if (((int) sizeof(buf)) < msg_min_size) { - zlog_err("%s: fd=%d: buf size=%zu lower than msg_min=%d", - __PRETTY_FUNCTION__, fd, sizeof(buf), msg_min_size); - return -1; - } - rd = read(fd, buf, sizeof(buf)); if (rd < 0) { zlog_warn("%s: failure reading fd=%d: errno=%d: %s", __PRETTY_FUNCTION__, fd, errno, safe_strerror(errno)); - return -2; - } - - if (rd < msg_min_size) { - zlog_warn("%s: short message reading fd=%d: read=%d msg_min=%d", - __PRETTY_FUNCTION__, fd, rd, msg_min_size); - return -3; + return -1; } return pim_mroute_msg(fd, buf, rd);