aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2010-09-23 08:13:24 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2010-09-23 08:13:24 +0000
commitca821b265461937a1f7ec1fc57985ee7b4816018 (patch)
treec233950d0fe0e6d1de45d47fe89835d6bf52a974
parent9b2c2bedb7e85d01b7761933267b046810b74dad (diff)
downloadaports-ca821b265461937a1f7ec1fc57985ee7b4816018.tar.bz2
aports-ca821b265461937a1f7ec1fc57985ee7b4816018.tar.xz
main/ipsec-tools: add a patch to modify receive buffer size
this fixing behaviour on long backbuffer of packets to start dropping packets instead of processing them late. (cherry picked from commit d9500f762a4c986fe5cfac8c69eb7fd8eb4e34c2) Conflicts: main/ipsec-tools/APKBUILD
-rw-r--r--main/ipsec-tools/70-rcvbuf-size.patch33
-rw-r--r--main/ipsec-tools/APKBUILD4
2 files changed, 36 insertions, 1 deletions
diff --git a/main/ipsec-tools/70-rcvbuf-size.patch b/main/ipsec-tools/70-rcvbuf-size.patch
new file mode 100644
index 0000000000..34e295decf
--- /dev/null
+++ b/main/ipsec-tools/70-rcvbuf-size.patch
@@ -0,0 +1,33 @@
+Index: src/racoon/isakmp.c
+===================================================================
+RCS file: /cvsroot/src/crypto/dist/ipsec-tools/src/racoon/isakmp.c,v
+retrieving revision 1.60
+diff -u -r1.60 isakmp.c
+--- a/src/racoon/isakmp.c 3 Sep 2009 09:29:07 -0000 1.60
++++ b/src/racoon/isakmp.c 20 Aug 2010 11:59:20 -0000
+@@ -1579,6 +1579,7 @@
+ #ifdef ENABLE_NATT
+ int option = -1;
+ #endif
++ int rcvSize = 16384;
+
+ /* warn if wildcard address - should we forbid this? */
+ switch (addr->sa_family) {
+@@ -1706,6 +1707,17 @@
+ goto err;
+ }
+
++ /* set receive buffer size - shouldn't be too large otherwise
++ * we can acommodate too long backbuffer of packets and not
++ * able to handle any packets in real time */
++ if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF,
++ (void*) &rcvSize, sizeof(rcvSize)) < 0) {
++ plog(LLV_ERROR, LOCATION, NULL,
++ "failed to set SO_RCVBUF size (%s).\n",
++ strerror(errno));
++ /* soft-error, continue even if this failed */
++ }
++
+ if (setsockopt_bypass(fd, addr->sa_family) < 0)
+ goto err;
+
diff --git a/main/ipsec-tools/APKBUILD b/main/ipsec-tools/APKBUILD
index 48760b57f0..6c6a0f8953 100644
--- a/main/ipsec-tools/APKBUILD
+++ b/main/ipsec-tools/APKBUILD
@@ -2,7 +2,7 @@
pkgname=ipsec-tools
pkgver=0.8_alpha20090903
_myver=0.8-alpha20090903
-pkgrel=7
+pkgrel=8
pkgdesc="User-space IPsec tools for various IPsec implementations"
url="http://ipsec-tools.sourceforge.net/"
license="BSD"
@@ -16,6 +16,7 @@ source="http://downloads.sourceforge.net/$pkgname/$pkgname-$_myver.tar.gz
60-debug-quick.patch
initial-contact-fix.diff
fd-priorities.patch
+ 70-rcvbuf-size.patch
90-openssl-oneshot.patch
"
@@ -64,4 +65,5 @@ md5sums="8ec28d4e89c0f5e49ae2caa7463fbcfd ipsec-tools-0.8-alpha20090903.tar.gz
baa13d7f0f48955c792f7fcd42a8587a 60-debug-quick.patch
69e06c5cc3a0c1cc8b10ddc89d1e644b initial-contact-fix.diff
c1e8b8dc80ef4b5d79fece52a4865e68 fd-priorities.patch
+f40c78e4ca4b92d2bf74e4fcf3a8d91f 70-rcvbuf-size.patch
11e2c21e443edab17725f74ffeaddb76 90-openssl-oneshot.patch"