sun purge
[unix-history] / usr / src / sys / netinet / tcp_output.c
index 6dc94b5..c89935d 100644 (file)
@@ -1,4 +1,4 @@
-/*     tcp_output.c    4.49    82/12/14        */
+/*     tcp_output.c    4.55    83/05/27        */
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -6,8 +6,11 @@
 #include "../h/protosw.h"
 #include "../h/socket.h"
 #include "../h/socketvar.h"
 #include "../h/protosw.h"
 #include "../h/socket.h"
 #include "../h/socketvar.h"
-#include "../netinet/in.h"
+#include "../h/errno.h"
+
 #include "../net/route.h"
 #include "../net/route.h"
+
+#include "../netinet/in.h"
 #include "../netinet/in_pcb.h"
 #include "../netinet/in_systm.h"
 #include "../netinet/ip.h"
 #include "../netinet/in_pcb.h"
 #include "../netinet/in_systm.h"
 #include "../netinet/ip.h"
@@ -20,9 +23,6 @@
 #include "../netinet/tcp_var.h"
 #include "../netinet/tcpip.h"
 #include "../netinet/tcp_debug.h"
 #include "../netinet/tcp_var.h"
 #include "../netinet/tcpip.h"
 #include "../netinet/tcp_debug.h"
-#include <errno.h>
-
-char *tcpstates[]; /* XXX */
 
 /*
  * Initial options.
 
 /*
  * Initial options.
@@ -45,7 +45,6 @@ tcp_output(tp)
        unsigned optlen = 0;
        int sendalot;
 
        unsigned optlen = 0;
        int sendalot;
 
-
        /*
         * Determine length of data that should be transmitted,
         * and flags that will be used.
        /*
         * Determine length of data that should be transmitted,
         * and flags that will be used.
@@ -141,8 +140,8 @@ send:
         * be transmitted, and initialize the header from
         * the template for sends on this connection.
         */
         * be transmitted, and initialize the header from
         * the template for sends on this connection.
         */
-       MGET(m, M_DONTWAIT, MT_DATA);
-       if (m == 0)
+       MGET(m, M_DONTWAIT, MT_HEADER);
+       if (m == NULL)
                return (ENOBUFS);
        m->m_off = MMAXOFF - sizeof (struct tcpiphdr);
        m->m_len = sizeof (struct tcpiphdr);
                return (ENOBUFS);
        m->m_off = MMAXOFF - sizeof (struct tcpiphdr);
        m->m_len = sizeof (struct tcpiphdr);
@@ -223,7 +222,7 @@ noopt:
        /*
         * If anything to send and we can send it all, set PUSH.
         * (This will keep happy those implementations which only
        /*
         * If anything to send and we can send it all, set PUSH.
         * (This will keep happy those implementations which only
-        * give data to the user when a buffer fills or a PUSH comes in.
+        * give data to the user when a buffer fills or a PUSH comes in.)
         */
        if (len && off+len == so->so_snd.sb_cc)
                ti->ti_flags |= TH_PUSH;
         */
        if (len && off+len == so->so_snd.sb_cc)
                ti->ti_flags |= TH_PUSH;
@@ -293,8 +292,12 @@ noopt:
         */
        ((struct ip *)ti)->ip_len = sizeof (struct tcpiphdr) + optlen + len;
        ((struct ip *)ti)->ip_ttl = TCP_TTL;
         */
        ((struct ip *)ti)->ip_len = sizeof (struct tcpiphdr) + optlen + len;
        ((struct ip *)ti)->ip_ttl = TCP_TTL;
-       if (error = ip_output(m, tp->t_ipopt, (so->so_options & SO_DONTROUTE) ?
-           &routetoif : &tp->t_inpcb->inp_route, 0))
+       if (so->so_options & SO_DONTROUTE)
+               error =
+                  ip_output(m, tp->t_ipopt, (struct route *)0, IP_ROUTETOIF);
+       else
+               error = ip_output(m, tp->t_ipopt, &tp->t_inpcb->inp_route, 0);
+       if (error)
                return (error);
 
        /*
                return (error);
 
        /*