When checking traffic endpoint's adresses families in key_spdadd(),

compare them together instead of comparing each one with respective
tunnel endpoint.

PR:	kern/138439
Submitted by:	aurelien.ansel@netasq.com
Obtained from:	NETASQ
MFC after:	1 m
This commit is contained in:
VANHULLEBUS Yvan 2009-09-16 11:56:44 +00:00
parent 102dfdb197
commit 22c125a1b6

View File

@ -1925,18 +1925,8 @@ key_spdadd(so, m, mhp)
return key_senderror(so, m, EINVAL);
}
#if 1
if (newsp->req && newsp->req->saidx.src.sa.sa_family) {
struct sockaddr *sa;
sa = (struct sockaddr *)(src0 + 1);
if (sa->sa_family != newsp->req->saidx.src.sa.sa_family) {
_key_delsp(newsp);
return key_senderror(so, m, EINVAL);
}
}
if (newsp->req && newsp->req->saidx.dst.sa.sa_family) {
struct sockaddr *sa;
sa = (struct sockaddr *)(dst0 + 1);
if (sa->sa_family != newsp->req->saidx.dst.sa.sa_family) {
if (newsp->req && newsp->req->saidx.src.sa.sa_family && newsp->req->saidx.dst.sa.sa_family) {
if (newsp->req->saidx.src.sa.sa_family != newsp->req->saidx.dst.sa.sa_family) {
_key_delsp(newsp);
return key_senderror(so, m, EINVAL);
}