summaryrefslogtreecommitdiffstats
path: root/sys/netipsec/key.c
diff options
context:
space:
mode:
authorbz <bz@FreeBSD.org>2010-10-23 20:35:40 +0000
committerbz <bz@FreeBSD.org>2010-10-23 20:35:40 +0000
commitde9392f9e014151a889a4d86de9f6736a94f158e (patch)
treef5d45570646bf96cfcb9125ee6a33290a6a158e2 /sys/netipsec/key.c
parent1f7e8301f37d1383a1b54e2fd57a8f750ee42848 (diff)
downloadFreeBSD-src-de9392f9e014151a889a4d86de9f6736a94f158e.zip
FreeBSD-src-de9392f9e014151a889a4d86de9f6736a94f158e.tar.gz
Make the IPsec SADB embedded route cache a union to be able to hold both the
legacy and IPv6 route destination address. Previously in case of IPv6, there was a memory overwrite due to not enough space for the IPv6 address. PR: kern/122565 MFC After: 2 weeks
Diffstat (limited to 'sys/netipsec/key.c')
-rw-r--r--sys/netipsec/key.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/netipsec/key.c b/sys/netipsec/key.c
index d00489d..e57eb44 100644
--- a/sys/netipsec/key.c
+++ b/sys/netipsec/key.c
@@ -2758,9 +2758,9 @@ key_delsah(sah)
/* remove from tree of SA index */
if (__LIST_CHAINED(sah))
LIST_REMOVE(sah, chain);
- if (sah->sa_route.ro_rt) {
- RTFREE(sah->sa_route.ro_rt);
- sah->sa_route.ro_rt = (struct rtentry *)NULL;
+ if (sah->route_cache.sa_route.ro_rt) {
+ RTFREE(sah->route_cache.sa_route.ro_rt);
+ sah->route_cache.sa_route.ro_rt = (struct rtentry *)NULL;
}
free(sah, M_IPSEC_SAH);
}
@@ -7925,7 +7925,7 @@ key_sa_routechange(dst)
SAHTREE_LOCK();
LIST_FOREACH(sah, &V_sahtree, chain) {
- ro = &sah->sa_route;
+ ro = &sah->route_cache.sa_route;
if (ro->ro_rt && dst->sa_len == ro->ro_dst.sa_len
&& bcmp(dst, &ro->ro_dst, dst->sa_len) == 0) {
RTFREE(ro->ro_rt);
OpenPOWER on IntegriCloud