summaryrefslogtreecommitdiffstats
path: root/sys/netinet6
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2006-01-30 08:39:09 +0000
committerglebius <glebius@FreeBSD.org>2006-01-30 08:39:09 +0000
commitaecf4a6244730d904a75f88ec9ea7eba0be9dd34 (patch)
treee06d7957fe2790ef47aabd00c8f3a9d96af9e3b5 /sys/netinet6
parent02a28f2514c2622f785b9c1e84417e4971151c72 (diff)
downloadFreeBSD-src-aecf4a6244730d904a75f88ec9ea7eba0be9dd34.zip
FreeBSD-src-aecf4a6244730d904a75f88ec9ea7eba0be9dd34.tar.gz
Add some initial locking to gif(4). It doesn't covers the whole driver,
however IPv4-in-IPv4 tunnels are now stable on SMP. Details: - Add per-softc mutex. - Hold the mutex on output. The main problem was the rtentry, placed in softc. It could be freed by ip_output(). Meanwhile, another thread being in in_gif_output() can read and write this rtentry. Reported by: many Tested by: Alexander Shiryaev <aixp mail.ru>
Diffstat (limited to 'sys/netinet6')
-rw-r--r--sys/netinet6/in6_gif.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/netinet6/in6_gif.c b/sys/netinet6/in6_gif.c
index 41c34f2..00ca2f2 100644
--- a/sys/netinet6/in6_gif.c
+++ b/sys/netinet6/in6_gif.c
@@ -97,6 +97,8 @@ in6_gif_output(ifp, family, m)
int proto, error;
u_int8_t itos, otos;
+ GIF_LOCK_ASSERT(sc);
+
if (sin6_src == NULL || sin6_dst == NULL ||
sin6_src->sin6_family != AF_INET6 ||
sin6_dst->sin6_family != AF_INET6) {
OpenPOWER on IntegriCloud