Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 106665
b: refs/heads/master
c: 73f18fd
h: refs/heads/master
i:
  106663: 576a76e
v: v3
  • Loading branch information
Gerrit Renker committed Jul 26, 2008
1 parent 446983f commit ef0baa9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 59435444a13ed52d3444c5df26b73d3086bcd57b
refs/heads/master: 73f18fdbca3f92b90aeaee16f5175fe30496e218
33 changes: 15 additions & 18 deletions trunk/net/dccp/output.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,11 @@ static int dccp_transmit_skb(struct sock *sk, struct sk_buff *skb)
dccp_packet_hdr_len(dcb->dccpd_type);
int err, set_ack = 1;
u64 ackno = dp->dccps_gsr;

dccp_inc_seqno(&dp->dccps_gss);
/*
* Increment GSS here already in case the option code needs it.
* Update GSS for real only if option processing below succeeds.
*/
dcb->dccpd_seq = ADD48(dp->dccps_gss, 1);

switch (dcb->dccpd_type) {
case DCCP_PKT_DATA:
Expand All @@ -66,6 +69,9 @@ static int dccp_transmit_skb(struct sock *sk, struct sk_buff *skb)

case DCCP_PKT_REQUEST:
set_ack = 0;
/* Use ISS on the first (non-retransmitted) Request. */
if (icsk->icsk_retransmits == 0)
dcb->dccpd_seq = dp->dccps_iss;
/* fall through */

case DCCP_PKT_SYNC:
Expand All @@ -84,8 +90,6 @@ static int dccp_transmit_skb(struct sock *sk, struct sk_buff *skb)
break;
}

dcb->dccpd_seq = dp->dccps_gss;

if (dccp_insert_options(sk, skb)) {
kfree_skb(skb);
return -EPROTO;
Expand All @@ -103,7 +107,7 @@ static int dccp_transmit_skb(struct sock *sk, struct sk_buff *skb)
/* XXX For now we're using only 48 bits sequence numbers */
dh->dccph_x = 1;

dp->dccps_awh = dp->dccps_gss;
dccp_update_gss(sk, dcb->dccpd_seq);
dccp_hdr_set_seq(dh, dp->dccps_gss);
if (set_ack)
dccp_hdr_set_ack(dccp_hdr_ack_bits(skb), ackno);
Expand All @@ -112,6 +116,11 @@ static int dccp_transmit_skb(struct sock *sk, struct sk_buff *skb)
case DCCP_PKT_REQUEST:
dccp_hdr_request(skb)->dccph_req_service =
dp->dccps_service;
/*
* Limit Ack window to ISS <= P.ackno <= GSS, so that
* only Responses to Requests we sent are considered.
*/
dp->dccps_awl = dp->dccps_iss;
break;
case DCCP_PKT_RESET:
dccp_hdr_reset(skb)->dccph_reset_code =
Expand Down Expand Up @@ -449,19 +458,7 @@ static inline void dccp_connect_init(struct sock *sk)

dccp_sync_mss(sk, dst_mtu(dst));

/*
* SWL and AWL are initially adjusted so that they are not less than
* the initial Sequence Numbers received and sent, respectively:
* SWL := max(GSR + 1 - floor(W/4), ISR),
* AWL := max(GSS - W' + 1, ISS).
* These adjustments MUST be applied only at the beginning of the
* connection.
*/
dccp_update_gss(sk, dp->dccps_iss);
dccp_set_seqno(&dp->dccps_awl, max48(dp->dccps_awl, dp->dccps_iss));

/* S.GAR - greatest valid acknowledgement number received on a non-Sync;
* initialized to S.ISS (sec. 8.5) */
/* Initialise GAR as per 8.5; AWL/AWH are set in dccp_transmit_skb() */
dp->dccps_gar = dp->dccps_iss;

icsk->icsk_retransmits = 0;
Expand Down

0 comments on commit ef0baa9

Please sign in to comment.