[OSKITTCP]
authorCameron Gutman <aicommander@gmail.com>
Thu, 19 Aug 2010 22:15:58 +0000 (22:15 +0000)
committerCameron Gutman <aicommander@gmail.com>
Thu, 19 Aug 2010 22:15:58 +0000 (22:15 +0000)
- Disable routing because oskit needs to let our code do that
- Comment out the ACK hack and restore the default BSD behavior

svn path=/trunk/; revision=48569

reactos/lib/drivers/oskittcp/oskittcp/interface.c
reactos/lib/drivers/oskittcp/oskittcp/tcp_input.c
reactos/lib/drivers/oskittcp/oskittcp/tcp_subr.c

index 3c589e7..db0b3a8 100644 (file)
@@ -129,6 +129,7 @@ int OskitTCPSocket( void *context,
     if( !error ) {
        so->so_connection = context;
        so->so_state |= SS_NBIO;
+    so->so_options |= SO_DONTROUTE;
        *aso = so;
     }
     OSKUnlock();
index 1811476..ed2759a 100644 (file)
@@ -84,6 +84,7 @@ struct inpcbinfo tcbinfo;
  * Set DELACK for segments received in order, but ack immediately
  * when segments are out of order (so fast retransmit can work).
  */
+#ifdef TCP_ACK_HACK
 #define        TCP_REASS(tp, ti, m, so, flags) { \
        if ((ti)->ti_seq == (tp)->rcv_nxt && \
            (tp)->seg_next == (struct tcpiphdr *)(tp) && \
@@ -103,6 +104,24 @@ struct inpcbinfo tcbinfo;
                tp->t_flags |= TF_ACKNOW; \
        } \
 }
+#else
+#define        TCP_REASS(tp, ti, m, so, flags) { \
+       if ((ti)->ti_seq == (tp)->rcv_nxt && \
+           (tp)->seg_next == (struct tcpiphdr *)(tp) && \
+           (tp)->t_state == TCPS_ESTABLISHED) { \
+               tp->t_flags |= TF_DELACK; \
+               (tp)->rcv_nxt += (ti)->ti_len; \
+               flags = (ti)->ti_flags & TH_FIN; \
+               tcpstat.tcps_rcvpack++;\
+               tcpstat.tcps_rcvbyte += (ti)->ti_len;\
+               sbappend(&(so)->so_rcv, (m)); \
+               sorwakeup(so); \
+       } else { \
+               (flags) = tcp_reass((tp), (ti), (m)); \
+               tp->t_flags |= TF_ACKNOW; \
+       } \
+}
+#endif
 #ifndef TUBA_INCLUDE
 
 int
@@ -573,6 +592,7 @@ findpcb:
                         */
                        sbappend(&so->so_rcv, m);
                        sorwakeup(so);
+#ifdef TCP_ACK_HACK
                        /*
                         * If this is a short packet, then ACK now - with Nagel
                         *      congestion avoidance sender won't send more until
@@ -584,6 +604,9 @@ findpcb:
                        } else {
                                tp->t_flags |= TF_DELACK;
                        }
+#else
+                       tp->t_flags |= TF_DELACK;
+#endif
                        return;
                }
        }
index 4632b68..b9c2151 100644 (file)
@@ -560,6 +560,7 @@ struct rtentry *
 tcp_rtlookup(inp)
        struct inpcb *inp;
 {
+#ifndef __REACTOS__
        struct route *ro;
        struct rtentry *rt;
 
@@ -576,7 +577,10 @@ tcp_rtlookup(inp)
                        rt = ro->ro_rt;
                }
        }
-       return rt;
+    return rt;
+#else
+    return NULL;
+#endif
 }
 
 /*