summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Greenman <dg@FreeBSD.org>1996-01-31 11:02:05 +0000
committerDavid Greenman <dg@FreeBSD.org>1996-01-31 11:02:05 +0000
commit9e5479e60f899bffe180cc7ccf1bc627cc967489 (patch)
treeacfca405369829ae1d9139ee48ebe79d976cbfce
parent2c778829f04535bec9272d4cc1504b649aa82d90 (diff)
Notes
-rw-r--r--sys/netinet/tcp_output.c13
-rw-r--r--sys/netinet/tcp_usrreq.c21
-rw-r--r--sys/netinet/tcp_var.h3
3 files changed, 25 insertions, 12 deletions
diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c
index 958713c48e32..cfed3d2fb26f 100644
--- a/sys/netinet/tcp_output.c
+++ b/sys/netinet/tcp_output.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tcp_output.c 8.3 (Berkeley) 12/30/93
- * $Id: tcp_output.c,v 1.12 1995/09/13 17:36:31 wollman Exp $
+ * $Id: tcp_output.c,v 1.11.4.1 1995/09/15 08:58:07 davidg Exp $
*/
#include <sys/param.h>
@@ -384,15 +384,8 @@ send:
case TH_SYN:
opt[optlen++] = TCPOPT_NOP;
opt[optlen++] = TCPOPT_NOP;
-
- if (taop->tao_ccsent != 0 &&
- CC_GEQ(tp->cc_send, taop->tao_ccsent)) {
- opt[optlen++] = TCPOPT_CC;
- taop->tao_ccsent = tp->cc_send;
- } else {
- opt[optlen++] = TCPOPT_CCNEW;
- taop->tao_ccsent = 0;
- }
+ opt[optlen++] = tp->t_flags & TF_SENDCCNEW ?
+ TCPOPT_CCNEW : TCPOPT_CC;
opt[optlen++] = TCPOLEN_CC;
*(u_int32_t *)&opt[optlen] = htonl(tp->cc_send);
optlen += 4;
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index 4ea6c47b7358..ac6e82cf18ca 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* From: @(#)tcp_usrreq.c 8.2 (Berkeley) 1/3/94
- * $Id: tcp_usrreq.c,v 1.15.2.1 1995/09/15 09:01:55 davidg Exp $
+ * $Id: tcp_usrreq.c,v 1.15.2.2 1995/11/03 07:53:59 davidg Exp $
*/
#include <sys/param.h>
@@ -407,6 +407,8 @@ tcp_connect(tp, nam)
struct sockaddr_in *sin = mtod(nam, struct sockaddr_in *);
struct sockaddr_in *ifaddr;
int error;
+ struct rmxp_tao *taop;
+ struct rmxp_tao tao_noncached;
if (inp->inp_lport == 0) {
error = in_pcbbind(inp, NULL);
@@ -459,7 +461,24 @@ tcp_connect(tp, nam)
tp->t_timer[TCPT_KEEP] = TCPTV_KEEP_INIT;
tp->iss = tcp_iss; tcp_iss += TCP_ISSINCR/2;
tcp_sendseqinit(tp);
+
+ /*
+ * Generate a CC value for this connection and
+ * check whether CC or CCnew should be used.
+ */
+ if ((taop = tcp_gettaocache(tp->t_inpcb)) == NULL) {
+ taop = &tao_noncached;
+ bzero(taop, sizeof(*taop));
+ }
+
tp->cc_send = CC_INC(tcp_ccgen);
+ if (taop->tao_ccsent != 0 &&
+ CC_GEQ(tp->cc_send, taop->tao_ccsent)) {
+ taop->tao_ccsent = tp->cc_send;
+ } else {
+ taop->tao_ccsent = 0;
+ tp->t_flags |= TF_SENDCCNEW;
+ }
return 0;
}
diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h
index 0ac6a74c61cb..9f3f6acfc128 100644
--- a/sys/netinet/tcp_var.h
+++ b/sys/netinet/tcp_var.h
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)tcp_var.h 8.3 (Berkeley) 4/10/94
- * $Id: tcp_var.h,v 1.11.4.1 1995/07/23 05:02:02 davidg Exp $
+ * $Id: tcp_var.h,v 1.11.4.2 1995/07/29 23:16:53 davidg Exp $
*/
#ifndef _NETINET_TCP_VAR_H_
@@ -70,6 +70,7 @@ struct tcpcb {
#define TF_NOPUSH 0x1000 /* don't push */
#define TF_REQ_CC 0x2000 /* have/will request CC */
#define TF_RCVD_CC 0x4000 /* a CC was received in SYN */
+#define TF_SENDCCNEW 0x8000 /* send CCnew instead of CC in SYN */
struct tcpiphdr *t_template; /* skeletal packet for transmit */
struct inpcb *t_inpcb; /* back pointer to internet pcb */