fix per Jeffrey Jongeward
[unix-history] / usr / src / sys / netinet / tcp_usrreq.c
index 9250b1f..b0ab7ea 100644 (file)
@@ -1,4 +1,4 @@
-/* tcp_usrreq.c 1.53 82/03/11 */
+/*     tcp_usrreq.c    1.57    82/04/30        */
 
 #include "../h/param.h"
 #include "../h/systm.h"
 
 #include "../h/param.h"
 #include "../h/systm.h"
@@ -7,6 +7,7 @@
 #include "../h/socketvar.h"
 #include "../h/protosw.h"
 #include "../net/in.h"
 #include "../h/socketvar.h"
 #include "../h/protosw.h"
 #include "../net/in.h"
+#include "../net/route.h"
 #include "../net/in_pcb.h"
 #include "../net/in_systm.h"
 #include "../net/if.h"
 #include "../net/in_pcb.h"
 #include "../net/in_systm.h"
 #include "../net/if.h"
@@ -19,7 +20,7 @@
 #include "../net/tcp_var.h"
 #include "../net/tcpip.h"
 #include "../net/tcp_debug.h"
 #include "../net/tcp_var.h"
 #include "../net/tcpip.h"
 #include "../net/tcp_debug.h"
-#include "../errno.h"
+#include <errno.h>
 
 /*
  * TCP protocol interface to socket abstraction.
 
 /*
  * TCP protocol interface to socket abstraction.
@@ -130,7 +131,7 @@ COUNT(TCP_USRREQ);
                tp->t_timer[TCPT_KEEP] = TCPTV_KEEP;
                tp->iss = tcp_iss; tcp_iss += TCP_ISSINCR/2;
                tcp_sendseqinit(tp);
                tp->t_timer[TCPT_KEEP] = TCPTV_KEEP;
                tp->iss = tcp_iss; tcp_iss += TCP_ISSINCR/2;
                tcp_sendseqinit(tp);
-               (void) tcp_output(tp);
+               error = tcp_output(tp);
                break;
 
        /*
                break;
 
        /*
@@ -171,7 +172,7 @@ COUNT(TCP_USRREQ);
        case PRU_SHUTDOWN:
                socantsendmore(so);
                tcp_usrclosed(tp);
        case PRU_SHUTDOWN:
                socantsendmore(so);
                tcp_usrclosed(tp);
-               (void) tcp_output(tp);
+               error = tcp_output(tp);
                break;
 
        /*
                break;
 
        /*
@@ -187,11 +188,11 @@ COUNT(TCP_USRREQ);
         */
        case PRU_SEND:
                sbappend(&so->so_snd, m);
         */
        case PRU_SEND:
                sbappend(&so->so_snd, m);
-/*
+#ifdef notdef
                if (tp->t_flags & TF_PUSH)
                        tp->snd_end = tp->snd_una + so->so_snd.sb_cc;
                if (tp->t_flags & TF_PUSH)
                        tp->snd_end = tp->snd_una + so->so_snd.sb_cc;
- */
-               (void) tcp_output(tp);
+#endif
+               error = tcp_output(tp);
                break;
 
        /*
                break;
 
        /*
@@ -232,7 +233,9 @@ COUNT(TCP_USRREQ);
                        tp->t_oobmark = tp->snd_una + so->so_snd.sb_cc;
 printf("sendoob seq now %x oobc %x\n", tp->t_oobseq, tp->t_oobc);
                        tp->t_oobflags |= TCPOOB_NEEDACK;
                        tp->t_oobmark = tp->snd_una + so->so_snd.sb_cc;
 printf("sendoob seq now %x oobc %x\n", tp->t_oobseq, tp->t_oobc);
                        tp->t_oobflags |= TCPOOB_NEEDACK;
-                       (void) tcp_output(tp);
+                       /* what to do ...? */
+                       if (error = tcp_output(tp))
+                               break;
                }
 #endif
                if (sbspace(&so->so_snd) < -512) {
                }
 #endif
                if (sbspace(&so->so_snd) < -512) {
@@ -241,15 +244,19 @@ printf("sendoob seq now %x oobc %x\n", tp->t_oobseq, tp->t_oobc);
                }
                tp->snd_up = tp->snd_una + so->so_snd.sb_cc + 1;
                sbappend(&so->so_snd, m);
                }
                tp->snd_up = tp->snd_una + so->so_snd.sb_cc + 1;
                sbappend(&so->so_snd, m);
-/*
+#ifdef notdef
                if (tp->t_flags & TF_PUSH)
                        tp->snd_end = tp->snd_una + so->so_snd.sb_cc;
                if (tp->t_flags & TF_PUSH)
                        tp->snd_end = tp->snd_una + so->so_snd.sb_cc;
- */
+#endif
                tp->t_force = 1;
                tp->t_force = 1;
-               (void) tcp_output(tp);
+               error = tcp_output(tp);
                tp->t_force = 0;
                break;
 
                tp->t_force = 0;
                break;
 
+       case PRU_SOCKADDR:
+               in_setsockaddr((struct sockaddr_in *)addr, inp);
+               break;
+
        /*
         * TCP slow timer went off; going through this
         * routine for tracing's sake.
        /*
         * TCP slow timer went off; going through this
         * routine for tracing's sake.
@@ -269,7 +276,7 @@ printf("sendoob seq now %x oobc %x\n", tp->t_oobseq, tp->t_oobc);
 }
 
 int    tcp_sendspace = 1024*2;
 }
 
 int    tcp_sendspace = 1024*2;
-int    tcp_recvspace = 1024*3;
+int    tcp_recvspace = 1024*2;
 /*
  * Attach TCP protocol to socket, allocating
  * internet protocol control block, tcp control block,
 /*
  * Attach TCP protocol to socket, allocating
  * internet protocol control block, tcp control block,