patch-2.4.26 linux-2.4.26/net/sctp/transport.c

Next file: linux-2.4.26/net/sctp/tsnmap.c
Previous file: linux-2.4.26/net/sctp/sysctl.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.25/net/sctp/transport.c linux-2.4.26/net/sctp/transport.c
@@ -83,8 +83,6 @@
 					   const union sctp_addr *addr,
 					   int gfp)
 {
-	struct sctp_protocol *proto = sctp_get_protocol();
-
 	/* Copy in the address.  */
 	peer->ipaddr = *addr;
 	peer->af_specific = sctp_get_af_specific(addr->sa.sa_family);
@@ -100,7 +98,7 @@
 	 * parameter 'RTO.Initial'.
 	 */
 	peer->rtt = 0;
-	peer->rto = proto->rto_initial;
+	peer->rto = sctp_rto_initial;
 	peer->rttvar = 0;
 	peer->srtt = 0;
 	peer->rto_pending = 0;
@@ -109,19 +107,18 @@
 	peer->last_time_used = jiffies;
 	peer->last_time_ecne_reduced = jiffies;
 
-	peer->active = 1;
+	peer->active = SCTP_ACTIVE;
 	peer->hb_allowed = 0;
 
 	/* Initialize the default path max_retrans.  */
-	peer->max_retrans = proto->max_retrans_path;
+	peer->max_retrans = sctp_max_retrans_path;
 	peer->error_threshold = 0;
 	peer->error_count = 0;
 
-	peer->debug_name = "unnamedtransport";
-
 	INIT_LIST_HEAD(&peer->transmitted);
 	INIT_LIST_HEAD(&peer->send_ready);
 	INIT_LIST_HEAD(&peer->transports);
+	sctp_packet_init(&peer->packet, peer, 0, 0);
 
 	/* Set up the retransmission timer.  */
 	init_timer(&peer->T3_rtx_timer);
@@ -138,6 +135,13 @@
 	peer->dead = 0;
 
 	peer->malloced = 0;
+
+	/* Initialize the state information for SFR-CACC */
+	peer->cacc.changeover_active = 0;
+	peer->cacc.cycling_changeover = 0;
+	peer->cacc.next_tsn_at_change = 0;
+	peer->cacc.cacc_saw_newack = 0;
+
 	return peer;
 }
 
@@ -241,7 +245,7 @@
 	if (dst) {
 		transport->pmtu = dst_pmtu(dst);
 
-		/* Initialize sk->rcv_saddr, if the transport is the
+		/* Initialize sk->sk_rcv_saddr, if the transport is the
 		 * association's active path for getsockname().
 		 */ 
 		if (asoc && (transport == asoc->peer.active_path))
@@ -268,8 +272,6 @@
 /* Update transport's RTO based on the newly calculated RTT. */
 void sctp_transport_update_rto(struct sctp_transport *tp, __u32 rtt)
 {
-	struct sctp_protocol *proto = sctp_get_protocol();
-
 	/* Check for valid transport.  */
 	SCTP_ASSERT(tp, "NULL transport", return);
 
@@ -288,10 +290,10 @@
 		 * For example, assuming the default value of RTO.Alpha of
 		 * 1/8, rto_alpha would be expressed as 3.
 		 */
-		tp->rttvar = tp->rttvar - (tp->rttvar >> proto->rto_beta)
-			+ ((abs(tp->srtt - rtt)) >> proto->rto_beta);
-		tp->srtt = tp->srtt - (tp->srtt >> proto->rto_alpha)
-			+ (rtt >> proto->rto_alpha);
+		tp->rttvar = tp->rttvar - (tp->rttvar >> sctp_rto_beta)
+			+ ((abs(tp->srtt - rtt)) >> sctp_rto_beta);
+		tp->srtt = tp->srtt - (tp->srtt >> sctp_rto_alpha)
+			+ (rtt >> sctp_rto_alpha);
 	} else {
 		/* 6.3.1 C2) When the first RTT measurement R is made, set
 		 * SRTT <- R, RTTVAR <- R/2.

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)