summaryrefslogtreecommitdiff
path: root/usr.sbin/ospfd/interface.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2009-08-09 23:04:17 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2009-08-09 23:04:17 +0000
commit4ad0571c604526a0bb64f7b2d6e62d9ac8366227 (patch)
treed6e52e23152cd510977ac1eedadba0d33c63d571 /usr.sbin/ospfd/interface.c
parent19b887359c4b05f1d1249927d8d894b26647c4ba (diff)
Scale both receive and send buffer on the raw socket. The default 8192
bytes is not enough for larger networks causing send errors because of too big packets. OK henning
Diffstat (limited to 'usr.sbin/ospfd/interface.c')
-rw-r--r--usr.sbin/ospfd/interface.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/usr.sbin/ospfd/interface.c b/usr.sbin/ospfd/interface.c
index 5e212044d6b..32844a5ef8d 100644
--- a/usr.sbin/ospfd/interface.c
+++ b/usr.sbin/ospfd/interface.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: interface.c,v 1.63 2009/06/05 04:12:52 claudio Exp $ */
+/* $OpenBSD: interface.c,v 1.64 2009/08/09 23:04:16 claudio Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -678,7 +678,7 @@ if_set_recvif(int fd, int enable)
}
void
-if_set_recvbuf(int fd)
+if_set_sockbuf(int fd)
{
int bsize;
@@ -686,6 +686,17 @@ if_set_recvbuf(int fd)
while (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &bsize,
sizeof(bsize)) == -1)
bsize /= 2;
+
+ if (bsize != 65535)
+ log_warnx("if_set_sockbuf: recvbuf size only %d", bsize);
+
+ bsize = 65535;
+ while (setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &bsize,
+ sizeof(bsize)) == -1)
+ bsize /= 2;
+
+ if (bsize != 65535)
+ log_warnx("if_set_sockbuf: sendbuf size only %d", bsize);
}
/*