]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/netinet/tcp_output.c
xnu-517.3.7.tar.gz
[apple/xnu.git] / bsd / netinet / tcp_output.c
index 2f5bab1192939ef0aed69e426974e8a778b7ab95..d35b91673127b1e06b101cc1554e27c0d45e44e9 100644 (file)
@@ -231,8 +231,8 @@ again:
         * come back before the TCP connection times out).
         */
 
-       if (tp->t_inpcb->inp_route.ro_rt != NULL &&
-           (tp->t_inpcb->inp_route.ro_rt->generation_id != route_generation)) {
+      if ((tp->t_inpcb->inp_route.ro_rt != NULL &&
+           (tp->t_inpcb->inp_route.ro_rt->generation_id != route_generation)) || (tp->t_inpcb->inp_route.ro_rt == NULL)) {
                /* check that the source address is still valid */
                if (ifa_foraddr(tp->t_inpcb->inp_laddr.s_addr) == NULL) {
                        if (tp->t_state >= TCPS_CLOSE_WAIT) {
@@ -258,10 +258,6 @@ again:
                        else
                                return(0); /* silently ignore and keep data in socket */
                }
-               else  { /* Clear the cached route, will be reacquired later */
-                       rtfree(tp->t_inpcb->inp_route.ro_rt);
-                       tp->t_inpcb->inp_route.ro_rt = (struct rtentry *)0;
-               }
         }
        }
        sendalot = 0;