aboutsummaryrefslogtreecommitdiffstats
path: root/main/ipsec-tools/75-racoonctl-rcvbuf.patch
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2010-10-14 15:55:53 +0300
committerTimo Teräs <timo.teras@iki.fi>2010-10-14 15:56:40 +0300
commitaa248c9684ebf2799649358e284acd19fe7192b7 (patch)
treef85b32a878b5694587945c06a42c195f50b246ab /main/ipsec-tools/75-racoonctl-rcvbuf.patch
parent93dd6f1ebc0e08ce90976c0ce67cffa37b591743 (diff)
downloadaports-aa248c9684ebf2799649358e284acd19fe7192b7.tar.bz2
aports-aa248c9684ebf2799649358e284acd19fe7192b7.tar.xz
main/ipsec-tools: racoonctl socket buffer size patch
will fix certain racoonctl errors if there are multiple simultaneous connections and the system socket buffer size is set low.
Diffstat (limited to 'main/ipsec-tools/75-racoonctl-rcvbuf.patch')
-rw-r--r--main/ipsec-tools/75-racoonctl-rcvbuf.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/main/ipsec-tools/75-racoonctl-rcvbuf.patch b/main/ipsec-tools/75-racoonctl-rcvbuf.patch
new file mode 100644
index 0000000000..3a68bfc2ae
--- /dev/null
+++ b/main/ipsec-tools/75-racoonctl-rcvbuf.patch
@@ -0,0 +1,33 @@
+Index: src/racoon/kmpstat.c
+===================================================================
+RCS file: /cvsroot/src/crypto/dist/ipsec-tools/src/racoon/kmpstat.c,v
+retrieving revision 1.6
+diff -u -r1.6 kmpstat.c
+--- a/src/racoon/kmpstat.c 2 Oct 2007 09:47:45 -0000 1.6
++++ b/src/racoon/kmpstat.c 14 Oct 2010 12:48:22 -0000
+@@ -99,6 +99,7 @@
+ com_init()
+ {
+ struct sockaddr_un name;
++ int rcvSize;
+
+ memset(&name, 0, sizeof(name));
+ name.sun_family = AF_UNIX;
+@@ -114,6 +115,17 @@
+ return -1;
+ }
+
++ /* set receive buffer size - should be relative large:
++ * racoon daemon will try to send all info in one go, if
++ * it does not fit we'll miss stuff */
++ rcvSize = 1024 * 1024;
++ if (setsockopt(so, SOL_SOCKET, SO_RCVBUF,
++ (void*) &rcvSize, sizeof(rcvSize)) < 0) {
++ rcvSize = 512 * 1024;
++ (void) setsockopt(so, SOL_SOCKET, SO_RCVBUF,
++ (void*) &rcvSize, sizeof(rcvSize));
++ }
++
+ return 0;
+ }
+