Date: Wed, 12 May 2010 11:49:16 +0000 (UTC) From: VANHULLEBUS Yvan <vanhu@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r207959 - stable/8/sys/netipsec Message-ID: <201005121149.o4CBnGrW098324@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: vanhu Date: Wed May 12 11:49:15 2010 New Revision: 207959 URL: http://svn.freebsd.org/changeset/base/207959 Log: MFC: Set/update SA's NAT-T stuff before calling key_mature() in key_add() and key_update(), as the SA may be used as soon as key_mature() has been called Obtained from: NETASQ Modified: stable/8/sys/netipsec/key.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/netipsec/key.c ============================================================================== --- stable/8/sys/netipsec/key.c Wed May 12 10:29:35 2010 (r207958) +++ stable/8/sys/netipsec/key.c Wed May 12 11:49:15 2010 (r207959) @@ -5158,12 +5158,6 @@ key_update(so, m, mhp) return key_senderror(so, m, error); } - /* check SA values to be mature. */ - if ((mhp->msg->sadb_msg_errno = key_mature(sav)) != 0) { - KEY_FREESAV(&sav); - return key_senderror(so, m, 0); - } - #ifdef IPSEC_NAT_T /* * Handle more NAT-T info if present, @@ -5190,6 +5184,12 @@ key_update(so, m, mhp) #endif #endif + /* check SA values to be mature. */ + if ((mhp->msg->sadb_msg_errno = key_mature(sav)) != 0) { + KEY_FREESAV(&sav); + return key_senderror(so, m, 0); + } + { struct mbuf *n; @@ -5424,12 +5424,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, @@ -5449,6 +5443,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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201005121149.o4CBnGrW098324>