aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2016-10-04 10:09:03 +0200
committerTobias Brunner <tobias@strongswan.org>2016-10-04 10:09:03 +0200
commitdcee481910726cfd9d0260f09f181b257d35f76c (patch)
treed198ec0462a5547bc3ae4f007b29f0fbd1ebf9ce
parent6b2814ab0e254c88a1816c1690e35bda505a0f34 (diff)
parentd5c6a0bac425d2524516476452747b989c8c5c93 (diff)
downloadstrongswan-dcee481910726cfd9d0260f09f181b257d35f76c.tar.bz2
strongswan-dcee481910726cfd9d0260f09f181b257d35f76c.tar.xz
Merge branch 'enable-fragmentation'
This enables IKE fragmentation by default. And also increases the default fragment size to 1280 bytes (the default for IPv6).
-rw-r--r--conf/options/charon.opt9
-rw-r--r--man/ipsec.conf.5.in9
-rw-r--r--src/libcharon/plugins/vici/vici_config.c2
-rw-r--r--src/libcharon/sa/ike_sa.c2
-rw-r--r--src/starter/confread.c1
-rw-r--r--src/swanctl/swanctl.opt6
6 files changed, 16 insertions, 13 deletions
diff --git a/conf/options/charon.opt b/conf/options/charon.opt
index 3970012d2..04e099e12 100644
--- a/conf/options/charon.opt
+++ b/conf/options/charon.opt
@@ -100,11 +100,12 @@ charon.flush_auth_cfg = no
charon.follow_redirects = yes
Whether to follow IKEv2 redirects (RFC 5685).
-charon.fragment_size = 0
+charon.fragment_size = 1280
Maximum size (complete IP datagram size in bytes) of a sent IKE fragment
- when using proprietary IKEv1 or standardized IKEv2 fragmentation (0 for
- address family specific default values). If specified this limit is used
- for both IPv4 and IPv6.
+ when using proprietary IKEv1 or standardized IKEv2 fragmentation, defaults
+ to 1280 (use 0 for address family specific default values, which uses a
+ lower value for IPv4). If specified this limit is used for both IPv4 and
+ IPv6.
charon.group
Name of the group the daemon changes to after startup.
diff --git a/man/ipsec.conf.5.in b/man/ipsec.conf.5.in
index 6d99e13f9..6f80709a6 100644
--- a/man/ipsec.conf.5.in
+++ b/man/ipsec.conf.5.in
@@ -445,14 +445,15 @@ force UDP encapsulation for ESP packets even if no NAT situation is detected.
This may help to surmount restrictive firewalls. In order to force the peer to
encapsulate packets, NAT detection payloads are faked.
.TP
-.BR fragmentation " = yes | force | " no
+.BR fragmentation " = " yes " | force | no"
whether to use IKE fragmentation (proprietary IKEv1 extension or IKEv2
fragmentation as per RFC 7383). Acceptable values are
-.BR yes ,
+.B yes
+(the default),
.B force
and
-.B no
-(the default). Fragmented IKE messages sent by a peer are always accepted
+.BR no .
+Fragmented IKE messages sent by a peer are always accepted
irrespective of the value of this option. If set to
.BR yes ,
and the peer supports it, larger IKE messages will be sent in fragments.
diff --git a/src/libcharon/plugins/vici/vici_config.c b/src/libcharon/plugins/vici/vici_config.c
index 224a51923..2110fd31d 100644
--- a/src/libcharon/plugins/vici/vici_config.c
+++ b/src/libcharon/plugins/vici/vici_config.c
@@ -1980,7 +1980,7 @@ CALLBACK(config_sn, bool,
.send_cert = CERT_SEND_IF_ASKED,
.version = IKE_ANY,
.remote_port = IKEV2_UDP_PORT,
- .fragmentation = FRAGMENTATION_NO,
+ .fragmentation = FRAGMENTATION_YES,
.unique = UNIQUE_NO,
.keyingtries = 1,
.rekey_time = LFT_UNDEFINED,
diff --git a/src/libcharon/sa/ike_sa.c b/src/libcharon/sa/ike_sa.c
index 239e260b1..ceeafcbb8 100644
--- a/src/libcharon/sa/ike_sa.c
+++ b/src/libcharon/sa/ike_sa.c
@@ -2979,7 +2979,7 @@ ike_sa_t * ike_sa_create(ike_sa_id_t *ike_sa_id, bool initiator,
.flush_auth_cfg = lib->settings->get_bool(lib->settings,
"%s.flush_auth_cfg", FALSE, lib->ns),
.fragment_size = lib->settings->get_int(lib->settings,
- "%s.fragment_size", 0, lib->ns),
+ "%s.fragment_size", 1280, lib->ns),
.follow_redirects = lib->settings->get_bool(lib->settings,
"%s.follow_redirects", TRUE, lib->ns),
);
diff --git a/src/starter/confread.c b/src/starter/confread.c
index 33924b065..3fb750e51 100644
--- a/src/starter/confread.c
+++ b/src/starter/confread.c
@@ -222,6 +222,7 @@ static void conn_defaults(starter_conn_t *conn)
conn->dpd_delay = 30; /* seconds */
conn->dpd_timeout = 150; /* seconds */
conn->replay_window = SA_REPLAY_WINDOW_DEFAULT;
+ conn->fragmentation = FRAGMENTATION_YES;
conn->left.sendcert = CERT_SEND_IF_ASKED;
conn->right.sendcert = CERT_SEND_IF_ASKED;
diff --git a/src/swanctl/swanctl.opt b/src/swanctl/swanctl.opt
index 2a4f5a789..c4d9f86d6 100644
--- a/src/swanctl/swanctl.opt
+++ b/src/swanctl/swanctl.opt
@@ -139,12 +139,12 @@ connections.<conn>.dpd_timeout = 0s
checking. For compatibility reasons, with IKEv1 a custom interval may be
specified; this option has no effect on connections using IKE2.
-connections.<conn>.fragmentation = no
+connections.<conn>.fragmentation = yes
Use IKE UDP datagram fragmentation. (_yes_, _no_ or _force_).
Use IKE fragmentation (proprietary IKEv1 extension or RFC 7383 IKEv2
- fragmentation). Acceptable values are _yes_, _force_ and _no_ (the
- default). Fragmented IKE messages sent by a peer are always accepted
+ fragmentation). Acceptable values are _yes_ (the default), _force_ and
+ _no_. Fragmented IKE messages sent by a peer are always accepted
irrespective of the value of this option. If set to _yes_, and the peer
supports it, oversized IKE messages will be sent in fragments. If set to
_force_ (only supported for IKEv1) the initial IKE message will already