summaryrefslogtreecommitdiffstats
path: root/sys/netipsec
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netipsec')
-rw-r--r--sys/netipsec/key.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/netipsec/key.c b/sys/netipsec/key.c
index 08547a8..3dc6878 100644
--- a/sys/netipsec/key.c
+++ b/sys/netipsec/key.c
@@ -3982,10 +3982,13 @@ key_ismyaddr6(sin6)
struct in6_multi *in6m;
#endif
+ IN6_IFADDR_RLOCK();
TAILQ_FOREACH(ia, &V_in6_ifaddrhead, ia_link) {
if (key_sockaddrcmp((struct sockaddr *)&sin6,
- (struct sockaddr *)&ia->ia_addr, 0) == 0)
+ (struct sockaddr *)&ia->ia_addr, 0) == 0) {
+ IN6_IFADDR_RUNLOCK();
return 1;
+ }
#if 0
/*
@@ -3996,10 +3999,13 @@ key_ismyaddr6(sin6)
*/
in6m = NULL;
IN6_LOOKUP_MULTI(sin6->sin6_addr, ia->ia_ifp, in6m);
- if (in6m)
+ if (in6m) {
+ IN6_IFADDR_RUNLOCK();
return 1;
+ }
#endif
}
+ IN6_IFADDR_RUNLOCK();
/* loopback, just for safety */
if (IN6_IS_ADDR_LOOPBACK(&sin6->sin6_addr))
OpenPOWER on IntegriCloud