]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd: Set pim socket receive buffer to a larger value
authorDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 18 Nov 2016 00:57:10 +0000 (19:57 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 22 Dec 2016 01:26:16 +0000 (20:26 -0500)
There exists situations where we can receive data
faster than we can process it.  Make the buffer
large enough to catch these situations for
the pim sockets.

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

index 681b5fe5c151e11690109b414c82c4e8ba98a3a7..12f222bb80dd40935be23fe6a5c1745bd495335d 100644 (file)
@@ -113,6 +113,7 @@ pim_socket_bind (int fd, struct interface *ifp)
 
 int pim_socket_mcast(int protocol, struct in_addr ifaddr, int ifindex, u_char loop)
 {
+  int rcvbuf = 1024 * 1024 * 8;
   struct ip_mreqn mreq;
   int fd;
 
@@ -225,6 +226,10 @@ int pim_socket_mcast(int protocol, struct in_addr ifaddr, int ifindex, u_char lo
     return PIM_SOCK_ERR_IFACE;
   }
 
+  if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &rcvbuf, sizeof(rcvbuf)))
+      zlog_warn("%s: Failure to set buffer size to %d",
+               __PRETTY_FUNCTION__, rcvbuf);
+
   {
     long flags;