]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Remove some impossible error conditions.
authorDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 9 Aug 2016 18:25:12 +0000 (14:25 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 22 Dec 2016 01:26:06 +0000 (20:26 -0500)
It is impossible that we can hit these error conditions.
Remove them from the code.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd/pim_mroute.c

index ab07cb6792de956939de950c2b520287129b23f7..f6808feb49122d899a33ce4e0c54abfc034924fe 100644 (file)
@@ -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);