diff options
author | Gerrit Renker <gerrit@erg.abdn.ac.uk> | 2006-11-13 10:12:07 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-03 00:22:17 -0500 |
commit | e11d9d30802278af22e78d8c10f348b683670cd9 (patch) | |
tree | ba084b0c5791090164363ad2aaec2c0ab241f603 /net/dccp | |
parent | 08a29e41bb6d6516b0f65e19381f537168d1768e (diff) |
[DCCP]: Increment sequence numbers on retransmitted Response packets
Problem:
Diffstat (limited to 'net/dccp')
-rw-r--r-- | net/dccp/minisocks.c | 16 | ||||
-rw-r--r-- | net/dccp/output.c | 4 |
2 files changed, 13 insertions, 7 deletions
diff --git a/net/dccp/minisocks.c b/net/dccp/minisocks.c index d3de696fe4bf..5b2773efd7c7 100644 --- a/net/dccp/minisocks.c +++ b/net/dccp/minisocks.c | |||
@@ -196,15 +196,17 @@ struct sock *dccp_check_req(struct sock *sk, struct sk_buff *skb, | |||
196 | 196 | ||
197 | /* Check for retransmitted REQUEST */ | 197 | /* Check for retransmitted REQUEST */ |
198 | if (dccp_hdr(skb)->dccph_type == DCCP_PKT_REQUEST) { | 198 | if (dccp_hdr(skb)->dccph_type == DCCP_PKT_REQUEST) { |
199 | if (after48(DCCP_SKB_CB(skb)->dccpd_seq, | 199 | struct dccp_request_sock *dreq = dccp_rsk(req); |
200 | dccp_rsk(req)->dreq_isr)) { | ||
201 | struct dccp_request_sock *dreq = dccp_rsk(req); | ||
202 | 200 | ||
201 | if (after48(DCCP_SKB_CB(skb)->dccpd_seq, dreq->dreq_isr)) { | ||
203 | dccp_pr_debug("Retransmitted REQUEST\n"); | 202 | dccp_pr_debug("Retransmitted REQUEST\n"); |
204 | /* Send another RESPONSE packet */ | 203 | dreq->dreq_isr = DCCP_SKB_CB(skb)->dccpd_seq; |
205 | dccp_set_seqno(&dreq->dreq_iss, dreq->dreq_iss + 1); | 204 | /* |
206 | dccp_set_seqno(&dreq->dreq_isr, | 205 | * Send another RESPONSE packet |
207 | DCCP_SKB_CB(skb)->dccpd_seq); | 206 | * To protect against Request floods, increment retrans |
207 | * counter (backoff, monitored by dccp_response_timer). | ||
208 | */ | ||
209 | req->retrans++; | ||
208 | req->rsk_ops->rtx_syn_ack(sk, req, NULL); | 210 | req->rsk_ops->rtx_syn_ack(sk, req, NULL); |
209 | } | 211 | } |
210 | /* Network Duplicate, discard packet */ | 212 | /* Network Duplicate, discard packet */ |
diff --git a/net/dccp/output.c b/net/dccp/output.c index 992caedd7725..08ee5547a2f2 100644 --- a/net/dccp/output.c +++ b/net/dccp/output.c | |||
@@ -332,6 +332,8 @@ struct sk_buff *dccp_make_response(struct sock *sk, struct dst_entry *dst, | |||
332 | skb->dst = dst_clone(dst); | 332 | skb->dst = dst_clone(dst); |
333 | 333 | ||
334 | dreq = dccp_rsk(req); | 334 | dreq = dccp_rsk(req); |
335 | if (inet_rsk(req)->acked) /* increase ISS upon retransmission */ | ||
336 | dccp_inc_seqno(&dreq->dreq_iss); | ||
335 | DCCP_SKB_CB(skb)->dccpd_type = DCCP_PKT_RESPONSE; | 337 | DCCP_SKB_CB(skb)->dccpd_type = DCCP_PKT_RESPONSE; |
336 | DCCP_SKB_CB(skb)->dccpd_seq = dreq->dreq_iss; | 338 | DCCP_SKB_CB(skb)->dccpd_seq = dreq->dreq_iss; |
337 | 339 | ||
@@ -354,6 +356,8 @@ struct sk_buff *dccp_make_response(struct sock *sk, struct dst_entry *dst, | |||
354 | 356 | ||
355 | dccp_csum_outgoing(skb); | 357 | dccp_csum_outgoing(skb); |
356 | 358 | ||
359 | /* We use `acked' to remember that a Response was already sent. */ | ||
360 | inet_rsk(req)->acked = 1; | ||
357 | DCCP_INC_STATS(DCCP_MIB_OUTSEGS); | 361 | DCCP_INC_STATS(DCCP_MIB_OUTSEGS); |
358 | return skb; | 362 | return skb; |
359 | } | 363 | } |