tcp: We have dropped T/TCP for a long time; remove the implied connection
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Sat, 22 Oct 2011 11:49:01 +0000 (19:49 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Sat, 22 Oct 2011 11:49:01 +0000 (19:49 +0800)
The hack padding at the end of the struct netmsg_pru_send is also removed,
since connect will not happen on the sending path at all.

sys/net/netmsg.h
sys/netinet/tcp_usrreq.c

index 6e98259..99df2b1 100644 (file)
@@ -185,12 +185,6 @@ struct netmsg_pru_send {
        struct sockaddr         *nm_addr;
        struct mbuf             *nm_control;
        struct thread           *nm_td;
-       /*
-        * XXX hack to be 100% certain netmsg_pru_send can be overwritten
-        * by netmsg_pru_connect
-        */
-       char                    nm_dummy[sizeof(struct netmsg_pru_connect) -
-                                        sizeof(struct netmsg_base)];
 };
 
 #define PRUS_OOB               0x1
index 1631f3b..f23799c 100644 (file)
@@ -729,15 +729,10 @@ tcp_usr_send(netmsg_t msg)
        struct socket *so = msg->send.base.nm_so;
        int flags = msg->send.nm_flags;
        struct mbuf *m = msg->send.nm_m;
-       struct sockaddr *nam = msg->send.nm_addr;
        struct mbuf *control = msg->send.nm_control;
-       struct thread *td = msg->send.nm_td;
        int error = 0;
        struct inpcb *inp;
        struct tcpcb *tp;
-#ifdef INET6
-       int isipv6;
-#endif
        TCPDEBUG0;
 
        inp = so->so_pcb;
@@ -756,9 +751,6 @@ tcp_usr_send(netmsg_t msg)
                TCPDEBUG1();
                goto out;
        }
-#ifdef INET6
-       isipv6 = nam && nam->sa_family == AF_INET6;
-#endif /* INET6 */
        tp = intotcpcb(inp);
        TCPDEBUG1();
        if (control) {
@@ -784,29 +776,6 @@ tcp_usr_send(netmsg_t msg)
        }
 
        /*
-        * Do implied connect if not yet connected.  Any data sent
-        * with the connect is handled by tcp_connect() and friends.
-        *
-        * NOTE!  PROTOCOL THREAD MAY BE CHANGED BY THE CONNECT!
-        */
-       if (nam && tp->t_state < TCPS_SYN_SENT) {
-               kprintf("implied fallback\n");
-               msg->connect.nm_nam = nam;
-               msg->connect.nm_td = td;
-               msg->connect.nm_m = m;
-               msg->connect.nm_flags = flags;
-               msg->connect.nm_reconnect = NMSG_RECONNECT_FALLBACK;
-#ifdef INET6
-               if (isipv6)
-                       tcp6_connect(msg);
-               else
-#endif /* INET6 */
-                       tcp_connect(msg);
-               /* msg invalid now */
-               return;
-       }
-
-       /*
         * Pump the data into the socket.
         */
        if (m)