Skip to content
Snippets Groups Projects
Commit b796b196 authored by Ken Zhu's avatar Ken Zhu
Browse files

openswan: fix too much opportunistic connection issue


When the side is in responder state and no active connection, the
kernel will send a request to start the connection. in the circumstance
of the peer keeps restarting, this case will cause the connection
keeping increasing and memory consuming.
Before start new connection, looking for if there is any connection
existing for the new pair, if it exists, don't creat new connection.

Change-Id: I8c38434824380ed46cd99dcd399d0300c7e80423
Signed-off-by: default avatarKen Zhu <guigenz@codeaurora.org>
diff -Nur a/programs/pluto/kernel.c openswan-2.6.51.3/programs/pluto/kernel.c
--- a/programs/pluto/kernel.c 2019-08-12 10:07:39.306136491 -0700
+++ openswan-2.6.51.3/programs/pluto/kernel.c 2019-08-12 10:07:55.006016536 -0700
@@ -150,6 +150,13 @@
* which can't do this itself.
*/
{
+ ip_address src, dst;
+ networkof(ours, &src);
+ networkof(his, &dst);
+ if (has_bare_hold(&src, &dst, transport_proto)) {
+ loglog(RC_COMMENT, "This hold acquire already existing");
+ return;
+ }
struct bare_shunt *bs = alloc_thing(struct bare_shunt, "bare shunt");
bs->why = clone_str(why, "story for bare shunt");
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment