diff options
author | glebius <glebius@FreeBSD.org> | 2006-01-30 08:39:09 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2006-01-30 08:39:09 +0000 |
commit | aecf4a6244730d904a75f88ec9ea7eba0be9dd34 (patch) | |
tree | e06d7957fe2790ef47aabd00c8f3a9d96af9e3b5 /sys/netinet | |
parent | 02a28f2514c2622f785b9c1e84417e4971151c72 (diff) | |
download | FreeBSD-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/netinet')
-rw-r--r-- | sys/netinet/in_gif.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/netinet/in_gif.c b/sys/netinet/in_gif.c index cc6b64d..b69346c 100644 --- a/sys/netinet/in_gif.c +++ b/sys/netinet/in_gif.c @@ -104,6 +104,8 @@ in_gif_output(ifp, family, m) int proto, error; u_int8_t tos; + GIF_LOCK_ASSERT(sc); + if (sin_src == NULL || sin_dst == NULL || sin_src->sin_family != AF_INET || sin_dst->sin_family != AF_INET) { |