From: Sepherosa Ziehau Date: Sat, 27 Dec 2008 07:18:25 +0000 (+0800) Subject: TCP socket's cached route entry could only be accessed on its owner CPU. X-Git-Tag: v2.3.0~204 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/1dbb35168d95be3f0a483542772161823a971dab TCP socket's cached route entry could only be accessed on its owner CPU. If not, print backtrace or panic the system based on route_assert_owner_access; this probably will not happen. --- diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c index 63700881dc..115b08614b 100644 --- a/sys/netinet/tcp_output.c +++ b/sys/netinet/tcp_output.c @@ -964,7 +964,8 @@ send: ip->ip_off |= IP_DF; error = ip_output(m, inp->inp_options, &inp->inp_route, - (so->so_options & SO_DONTROUTE), NULL, inp); + (so->so_options & SO_DONTROUTE) | + IP_DEBUGROUTE, NULL, inp); } if (error) { diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 2d5a554bb2..6781701c03 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -672,6 +672,7 @@ tcp_respond(struct tcpcb *tp, void *ipgen, struct tcphdr *th, struct mbuf *m, ro6->ro_rt = NULL; } } else { + ipflags |= IP_DEBUGROUTE; ip_output(m, NULL, ro, ipflags, NULL, tp ? tp->t_inpcb : NULL); if ((ro == &sro) && (ro->ro_rt != NULL)) { RTFREE(ro->ro_rt); diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index 22f5f9fac9..f16ab8b980 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -1266,8 +1266,8 @@ no_options: htons(tlen - hlen + IPPROTO_TCP)); m->m_pkthdr.csum_flags = CSUM_TCP; m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); - error = ip_output(m, sc->sc_ipopts, &sc->sc_route, 0, NULL, - sc->sc_tp->t_inpcb); + error = ip_output(m, sc->sc_ipopts, &sc->sc_route, + IP_DEBUGROUTE, NULL, sc->sc_tp->t_inpcb); } return (error); }