diff options
author | sam <sam@FreeBSD.org> | 2003-10-07 20:57:35 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2003-10-07 20:57:35 +0000 |
commit | 5506d3b8f4eac4336d23daf44417b0edeb385798 (patch) | |
tree | a9d8c6e69470f1ed6bc32385a67b8b8fe4e1d734 | |
parent | 2a03d283e42c2c9734c36c8fc927a8cea1bcdef5 (diff) | |
download | FreeBSD-src-5506d3b8f4eac4336d23daf44417b0edeb385798.zip FreeBSD-src-5506d3b8f4eac4336d23daf44417b0edeb385798.tar.gz |
must lock route when the caller provided a route but not
an interface; otherwise the subsequent unlock blows up
Suffered by: Marcel Moolenaar <marcel@xcllnt.net>
Supported by: FreeBSD Foundation
-rw-r--r-- | sys/netinet6/ip6_output.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c index a7050e3..47376d5 100644 --- a/sys/netinet6/ip6_output.c +++ b/sys/netinet6/ip6_output.c @@ -609,6 +609,7 @@ skip_ipsec2:; /* XXX in6_ifstat_inc(ifp, ifs6_out_discard); */ goto bad; } + /* XXX rt not locked */ ia = ifatoia6(ro->ro_rt->rt_ifa); ifp = ro->ro_rt->rt_ifp; ro->ro_rt->rt_use++; @@ -694,10 +695,11 @@ skip_ipsec2:; * ``net'' ff00::/8). */ if (ifp == NULL) { - if (ro->ro_rt == 0) { + if (ro->ro_rt == 0) ro->ro_rt = rtalloc1((struct sockaddr *) &ro->ro_dst, 0, 0UL); - } + else + RT_LOCK(ro->ro_rt); if (ro->ro_rt == 0) { ip6stat.ip6s_noroute++; error = EHOSTUNREACH; |