aboutsummaryrefslogtreecommitdiffstats
path: root/main/ipsec-tools/75-racoonctl-rcvbuf.patch
blob: 3a68bfc2ae62b3e99b738a3711ed1dfc1ef50b1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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;
 }