summaryrefslogtreecommitdiffstats
path: root/sys/netipsec
diff options
context:
space:
mode:
authorvanhu <vanhu@FreeBSD.org>2010-05-05 08:58:58 +0000
committervanhu <vanhu@FreeBSD.org>2010-05-05 08:58:58 +0000
commitb9358a210eef916d6fd2297113ab434502924bd2 (patch)
tree90aab5b653c7509b07d230c29836851cee69f329 /sys/netipsec
parent33dc72ec8c82736f5d5c2ab5c7e57aad0f4ba647 (diff)
downloadFreeBSD-src-b9358a210eef916d6fd2297113ab434502924bd2.zip
FreeBSD-src-b9358a210eef916d6fd2297113ab434502924bd2.tar.gz
Set SA's natt_type before calling key_mature() in key_add(),
as the SA may be used as soon as key_mature() has been done. Obtained from: NETASQ MFC after: 1 week
Diffstat (limited to 'sys/netipsec')
-rw-r--r--sys/netipsec/key.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/netipsec/key.c b/sys/netipsec/key.c
index 7fc199a..d00489d 100644
--- a/sys/netipsec/key.c
+++ b/sys/netipsec/key.c
@@ -5422,12 +5422,6 @@ key_add(so, m, mhp)
return key_senderror(so, m, error);
}
- /* check SA values to be mature. */
- if ((error = key_mature(newsav)) != 0) {
- KEY_FREESAV(&newsav);
- return key_senderror(so, m, error);
- }
-
#ifdef IPSEC_NAT_T
/*
* Handle more NAT-T info if present,
@@ -5447,6 +5441,12 @@ key_add(so, m, mhp)
#endif
#endif
+ /* check SA values to be mature. */
+ if ((error = key_mature(newsav)) != 0) {
+ KEY_FREESAV(&newsav);
+ return key_senderror(so, m, error);
+ }
+
/*
* don't call key_freesav() here, as we would like to keep the SA
* in the database on success.
OpenPOWER on IntegriCloud