diff options
author | Timo Teräs <timo.teras@iki.fi> | 2010-08-20 15:04:28 +0300 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2010-09-23 08:12:17 +0000 |
commit | fad32c9f2e2fc370522f1006be682299520933f1 (patch) | |
tree | 56b8f4705d40c46fd5b4f7ee68f6ebdc2e1859eb | |
parent | 7514f306ab50a8f067e979ab0034995be2e6d26c (diff) | |
download | alpine_aports-fad32c9f2e2fc370522f1006be682299520933f1.tar.bz2 alpine_aports-fad32c9f2e2fc370522f1006be682299520933f1.tar.xz alpine_aports-fad32c9f2e2fc370522f1006be682299520933f1.zip |
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)
-rw-r--r-- | main/ipsec-tools/70-rcvbuf-size.patch | 33 | ||||
-rw-r--r-- | main/ipsec-tools/APKBUILD | 4 |
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 @@ | |||
1 | Index: src/racoon/isakmp.c | ||
2 | =================================================================== | ||
3 | RCS file: /cvsroot/src/crypto/dist/ipsec-tools/src/racoon/isakmp.c,v | ||
4 | retrieving revision 1.60 | ||
5 | diff -u -r1.60 isakmp.c | ||
6 | --- a/src/racoon/isakmp.c 3 Sep 2009 09:29:07 -0000 1.60 | ||
7 | +++ b/src/racoon/isakmp.c 20 Aug 2010 11:59:20 -0000 | ||
8 | @@ -1579,6 +1579,7 @@ | ||
9 | #ifdef ENABLE_NATT | ||
10 | int option = -1; | ||
11 | #endif | ||
12 | + int rcvSize = 16384; | ||
13 | |||
14 | /* warn if wildcard address - should we forbid this? */ | ||
15 | switch (addr->sa_family) { | ||
16 | @@ -1706,6 +1707,17 @@ | ||
17 | goto err; | ||
18 | } | ||
19 | |||
20 | + /* set receive buffer size - shouldn't be too large otherwise | ||
21 | + * we can acommodate too long backbuffer of packets and not | ||
22 | + * able to handle any packets in real time */ | ||
23 | + if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, | ||
24 | + (void*) &rcvSize, sizeof(rcvSize)) < 0) { | ||
25 | + plog(LLV_ERROR, LOCATION, NULL, | ||
26 | + "failed to set SO_RCVBUF size (%s).\n", | ||
27 | + strerror(errno)); | ||
28 | + /* soft-error, continue even if this failed */ | ||
29 | + } | ||
30 | + | ||
31 | if (setsockopt_bypass(fd, addr->sa_family) < 0) | ||
32 | goto err; | ||
33 | |||
diff --git a/main/ipsec-tools/APKBUILD b/main/ipsec-tools/APKBUILD index 5534d78b7a..75ac34839f 100644 --- a/main/ipsec-tools/APKBUILD +++ b/main/ipsec-tools/APKBUILD | |||
@@ -2,7 +2,7 @@ | |||
2 | pkgname=ipsec-tools | 2 | pkgname=ipsec-tools |
3 | pkgver=0.8_alpha20090903 | 3 | pkgver=0.8_alpha20090903 |
4 | _myver=0.8-alpha20090903 | 4 | _myver=0.8-alpha20090903 |
5 | pkgrel=9 | 5 | pkgrel=10 |
6 | pkgdesc="User-space IPsec tools for various IPsec implementations" | 6 | pkgdesc="User-space IPsec tools for various IPsec implementations" |
7 | url="http://ipsec-tools.sourceforge.net/" | 7 | url="http://ipsec-tools.sourceforge.net/" |
8 | license="BSD" | 8 | license="BSD" |
@@ -16,6 +16,7 @@ source="http://downloads.sourceforge.net/$pkgname/$pkgname-$_myver.tar.gz | |||
16 | 60-debug-quick.patch | 16 | 60-debug-quick.patch |
17 | initial-contact-fix.diff | 17 | initial-contact-fix.diff |
18 | fd-priorities.patch | 18 | fd-priorities.patch |
19 | 70-rcvbuf-size.patch | ||
19 | 90-openssl-oneshot.patch | 20 | 90-openssl-oneshot.patch |
20 | " | 21 | " |
21 | 22 | ||
@@ -64,4 +65,5 @@ md5sums="8ec28d4e89c0f5e49ae2caa7463fbcfd ipsec-tools-0.8-alpha20090903.tar.gz | |||
64 | baa13d7f0f48955c792f7fcd42a8587a 60-debug-quick.patch | 65 | baa13d7f0f48955c792f7fcd42a8587a 60-debug-quick.patch |
65 | 69e06c5cc3a0c1cc8b10ddc89d1e644b initial-contact-fix.diff | 66 | 69e06c5cc3a0c1cc8b10ddc89d1e644b initial-contact-fix.diff |
66 | c1e8b8dc80ef4b5d79fece52a4865e68 fd-priorities.patch | 67 | c1e8b8dc80ef4b5d79fece52a4865e68 fd-priorities.patch |
68 | f40c78e4ca4b92d2bf74e4fcf3a8d91f 70-rcvbuf-size.patch | ||
67 | 11e2c21e443edab17725f74ffeaddb76 90-openssl-oneshot.patch" | 69 | 11e2c21e443edab17725f74ffeaddb76 90-openssl-oneshot.patch" |