diff options
author | vanhu <vanhu@FreeBSD.org> | 2009-09-16 11:56:44 +0000 |
---|---|---|
committer | vanhu <vanhu@FreeBSD.org> | 2009-09-16 11:56:44 +0000 |
commit | 550a925d5c0272c65a2722727a6a6c0d90818cf9 (patch) | |
tree | fad44e5492bbcc5bf1aa4b6ee6cc24aee4bec1e9 | |
parent | 3dbcc8e70f520a33d646ba322207467f2e2bac48 (diff) | |
download | FreeBSD-src-550a925d5c0272c65a2722727a6a6c0d90818cf9.zip FreeBSD-src-550a925d5c0272c65a2722727a6a6c0d90818cf9.tar.gz |
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
-rw-r--r-- | sys/netipsec/key.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/sys/netipsec/key.c b/sys/netipsec/key.c index bf9db68..3cc5a6c 100644 --- a/sys/netipsec/key.c +++ b/sys/netipsec/key.c @@ -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); } |