From: Donald Sharp Date: Fri, 18 Nov 2016 00:57:10 +0000 (-0500) Subject: pimd: Set pim socket receive buffer to a larger value X-Git-Tag: frr-3.0-branchpoint~64^2~10^2~74 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=55a645a636fbfcd0920775933cd3bb9e51660d4f;p=matthieu%2Ffrr.git pimd: Set pim socket receive buffer to a larger value 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 --- diff --git a/pimd/pim_sock.c b/pimd/pim_sock.c index 681b5fe5c1..12f222bb80 100644 --- a/pimd/pim_sock.c +++ b/pimd/pim_sock.c @@ -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;