diff options
author | Gleb Smirnoff <glebius@FreeBSD.org> | 2006-01-30 08:39:09 +0000 |
---|---|---|
committer | Gleb Smirnoff <glebius@FreeBSD.org> | 2006-01-30 08:39:09 +0000 |
commit | 25af0bb50e0b9df77daf5239d1cf150951e83ab8 (patch) | |
tree | e06d7957fe2790ef47aabd00c8f3a9d96af9e3b5 /sys/netinet6/in6_gif.c | |
parent | f2a49a97ac73bbf77901106c1fc040fccc277e18 (diff) | |
download | src-25af0bb50e0b9df77daf5239d1cf150951e83ab8.tar.gz src-25af0bb50e0b9df77daf5239d1cf150951e83ab8.zip |
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>
Notes
Notes:
svn path=/head/; revision=155037
Diffstat (limited to 'sys/netinet6/in6_gif.c')
-rw-r--r-- | sys/netinet6/in6_gif.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/netinet6/in6_gif.c b/sys/netinet6/in6_gif.c index 41c34f2051af..00ca2f2bcdd2 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) { |