summaryrefslogtreecommitdiffstats
path: root/sys/netinet6
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2002-03-25 10:46:24 +0000
committerume <ume@FreeBSD.org>2002-03-25 10:46:24 +0000
commit31c9c349f875fcad64358398dd2efde0b96617d8 (patch)
tree44c0ce665677c85e98883c3f479ba5b536a4fd75 /sys/netinet6
parent583a5ab329725a1b59155d11e9be3f3c24e6643f (diff)
downloadFreeBSD-src-31c9c349f875fcad64358398dd2efde0b96617d8.zip
FreeBSD-src-31c9c349f875fcad64358398dd2efde0b96617d8.tar.gz
Corrected arguments to key_allocsa called from
{esp6, ah6}_ctlinput. Previous ones were uninitialized auto variables, which were completely bogus. Obtained from: KAME MFC after: 1 week
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/ah_input.c8
-rw-r--r--sys/netinet6/esp_input.c10
2 files changed, 11 insertions, 7 deletions
diff --git a/sys/netinet6/ah_input.c b/sys/netinet6/ah_input.c
index c4cc556..2b76d23 100644
--- a/sys/netinet6/ah_input.c
+++ b/sys/netinet6/ah_input.c
@@ -974,7 +974,7 @@ ah6_ctlinput(cmd, sa, d)
struct mbuf *m;
struct ip6ctlparam *ip6cp = NULL;
int off;
- struct sockaddr_in6 sa6_src, sa6_dst;
+ struct sockaddr_in6 *sa6_src, *sa6_dst;
if (sa->sa_family != AF_INET6 ||
sa->sa_len != sizeof(struct sockaddr_in6))
@@ -1021,9 +1021,11 @@ ah6_ctlinput(cmd, sa, d)
* Check to see if we have a valid SA corresponding to
* the address in the ICMP message payload.
*/
+ sa6_src = ip6cp->ip6c_src;
+ sa6_dst = (struct sockaddr_in6 *)sa;
sav = key_allocsa(AF_INET6,
- (caddr_t)&sa6_src.sin6_addr,
- (caddr_t)&sa6_dst.sin6_addr,
+ (caddr_t)&sa6_src->sin6_addr,
+ (caddr_t)&sa6_dst->sin6_addr,
IPPROTO_AH, ahp->ah_spi);
if (sav) {
if (sav->state == SADB_SASTATE_MATURE ||
diff --git a/sys/netinet6/esp_input.c b/sys/netinet6/esp_input.c
index 74e6830..6a66450 100644
--- a/sys/netinet6/esp_input.c
+++ b/sys/netinet6/esp_input.c
@@ -898,7 +898,7 @@ esp6_ctlinput(cmd, sa, d)
struct ip6_hdr *ip6;
struct mbuf *m;
int off;
- struct sockaddr_in6 sa6_src, sa6_dst;
+ struct sockaddr_in6 *sa6_src, *sa6_dst;
if (sa->sa_family != AF_INET6 ||
sa->sa_len != sizeof(struct sockaddr_in6))
@@ -963,10 +963,12 @@ esp6_ctlinput(cmd, sa, d)
* Check to see if we have a valid SA corresponding to
* the address in the ICMP message payload.
*/
+ sa6_src = ip6cp->ip6c_src;
+ sa6_dst = (struct sockaddr_in6 *)sa;
sav = key_allocsa(AF_INET6,
- (caddr_t)&sa6_src.sin6_addr,
- (caddr_t)&sa6_dst, IPPROTO_ESP,
- espp->esp_spi);
+ (caddr_t)&sa6_src->sin6_addr,
+ (caddr_t)&sa6_dst->sin6_addr,
+ IPPROTO_ESP, espp->esp_spi);
if (sav) {
if (sav->state == SADB_SASTATE_MATURE ||
sav->state == SADB_SASTATE_DYING)
OpenPOWER on IntegriCloud