TCP socket's cached route entry could only be accessed on its owner CPU.
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Sat, 27 Dec 2008 07:18:25 +0000 (15:18 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Sat, 27 Dec 2008 07:21:33 +0000 (15:21 +0800)
If not, print backtrace or panic the system based on
route_assert_owner_access; this probably will not happen.

sys/netinet/tcp_output.c
sys/netinet/tcp_subr.c
sys/netinet/tcp_syncache.c

index 6370088..115b086 100644 (file)
@@ -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) {
 
index 2d5a554..6781701 100644 (file)
@@ -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);
index 22f5f9f..f16ab8b 100644 (file)
@@ -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);
 }