summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorEsben Norby <norby@cvs.openbsd.org>2005-12-04 20:49:48 +0000
committerEsben Norby <norby@cvs.openbsd.org>2005-12-04 20:49:48 +0000
commit7c35c969b24badc396b0df721f5418c0a1aba692 (patch)
tree803c8b0f12a2a79df1cc6a327515e002e1d05964 /usr.sbin
parent855285a7671aca79b64b58cc81aa4838bb4a8860 (diff)
Increase the receive buffer of the raw socket.
Prevents some of the retransmitting during bulk ls update transfers. ok claudio@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ospfd/interface.c13
-rw-r--r--usr.sbin/ospfd/ospfe.c4
-rw-r--r--usr.sbin/ospfd/ospfe.h3
3 files changed, 17 insertions, 3 deletions
diff --git a/usr.sbin/ospfd/interface.c b/usr.sbin/ospfd/interface.c
index 9534244682a..c22420c4779 100644
--- a/usr.sbin/ospfd/interface.c
+++ b/usr.sbin/ospfd/interface.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: interface.c,v 1.38 2005/10/19 21:43:20 claudio Exp $ */
+/* $OpenBSD: interface.c,v 1.39 2005/12/04 20:49:47 norby Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -737,6 +737,17 @@ if_set_tos(int fd, int tos)
return (0);
}
+void
+if_set_recvbuf(int fd)
+{
+ int bsize;
+
+ bsize = 65535;
+ while (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &bsize,
+ sizeof(bsize)) == -1)
+ bsize /= 2;
+}
+
int
if_join_group(struct iface *iface, struct in_addr *addr)
{
diff --git a/usr.sbin/ospfd/ospfe.c b/usr.sbin/ospfd/ospfe.c
index 50e01f78003..a94e62dbcee 100644
--- a/usr.sbin/ospfd/ospfe.c
+++ b/usr.sbin/ospfd/ospfe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ospfe.c,v 1.33 2005/10/19 21:43:20 claudio Exp $ */
+/* $OpenBSD: ospfe.c,v 1.34 2005/12/04 20:49:47 norby Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -107,6 +107,8 @@ ospfe(struct ospfd_conf *xconf, int pipe_parent2ospfe[2], int pipe_ospfe2rde[2],
if (if_set_tos(xconf->ospf_socket, IPTOS_PREC_INTERNETCONTROL) == -1)
fatal("if_set_tos");
+ if_set_recvbuf(xconf->ospf_socket);
+
oeconf = xconf;
if ((pw = getpwnam(OSPFD_USER)) == NULL)
diff --git a/usr.sbin/ospfd/ospfe.h b/usr.sbin/ospfd/ospfe.h
index b90e3deba1a..58d9842e99b 100644
--- a/usr.sbin/ospfd/ospfe.h
+++ b/usr.sbin/ospfd/ospfe.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ospfe.h,v 1.17 2005/11/04 10:19:16 claudio Exp $ */
+/* $OpenBSD: ospfe.h,v 1.18 2005/12/04 20:49:47 norby Exp $ */
/*
* Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
@@ -203,6 +203,7 @@ int if_leave_group(struct iface *, struct in_addr *);
int if_set_mcast(struct iface *);
int if_set_mcast_ttl(int, u_int8_t);
int if_set_tos(int, int);
+void if_set_recvbuf(int);
int if_set_mcast_loop(int);
/* lsack.c */