summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2015-05-19 18:03:39 -0700
committerDonald Sharp <sharpd@cumulusnetworks.com>2015-05-19 18:03:39 -0700
commit60e42c52d6c9f3204f4b90c44413b1c392cd3b6c (patch)
tree97e7d2d697d37a567aab4ab6a7e2b9f64ddbd702
parent3f3dd76fcf93d1d3f55a0bc57425567aec5b22ad (diff)
Increase SO_SNDBUF and SO_RCVBUF to 8MB to avoid drops in large networks.
-rw-r--r--ospf6d/ospf6_network.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/ospf6d/ospf6_network.c b/ospf6d/ospf6_network.c
index 74cfbec7c7..3f38cafa13 100644
--- a/ospf6d/ospf6_network.c
+++ b/ospf6d/ospf6_network.c
@@ -127,6 +127,9 @@ ospf6_sso (u_int ifindex, struct in6_addr *group, int option)
{
struct ipv6_mreq mreq6;
int ret;
+ int bufsize = (8 * 1024 * 1024);
+ int optval;
+ socklen_t optlen = sizeof(optval);
assert (ifindex);
mreq6.ipv6mr_interface = ifindex;
@@ -137,6 +140,38 @@ ospf6_sso (u_int ifindex, struct in6_addr *group, int option)
if (ret < 0)
zlog_err ("Network: setsockopt (%d) on ifindex %d failed: %s",
option, ifindex, safe_strerror (errno));
+
+ if ((ret = setsockopt (ospf6_sock, SOL_SOCKET, SO_SNDBUF,
+ &bufsize, sizeof (bufsize))) < 0)
+ {
+ zlog_err ("Couldn't increase raw wbuf size: %s\n", safe_strerror(errno));
+ }
+
+ if ((ret = getsockopt (ospf6_sock, SOL_SOCKET, SO_SNDBUF,
+ &optval, &optlen)) < 0)
+ {
+ zlog_err ("getsockopt of SO_SNDBUF failed with error %s\n", safe_strerror(errno));
+ }
+ else if (optval < bufsize)
+ {
+ zlog_err ("Unable to SO_SNDBUF to %d, set to %d\n", bufsize, optval);
+ }
+
+ if ((ret = setsockopt (ospf6_sock, SOL_SOCKET, SO_RCVBUF,
+ &bufsize, sizeof (bufsize))) < 0)
+ {
+ zlog_err ("Couldn't increase raw rbuf size: %s\n", safe_strerror(errno));
+ }
+
+ if ((ret = getsockopt (ospf6_sock, SOL_SOCKET, SO_RCVBUF,
+ &optval, &optlen)) < 0)
+ {
+ zlog_err ("getsockopt of SO_RCVBUF failed with error %s\n", safe_strerror(errno));
+ }
+ else if (optval < bufsize)
+ {
+ zlog_err ("Unable to SO_RCVBUF to %d, set to %d\n", bufsize, optval);
+ }
}
static int