aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/ccids
diff options
context:
space:
mode:
authorGerrit Renker <gerrit@erg.abdn.ac.uk>2007-11-24 19:04:35 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 17:54:57 -0500
commit63df18ad7fb91c65dafc89d3cf94a58a486ad416 (patch)
tree63172fb7125c990516430ef8b4e50648079d89fd /net/dccp/ccids
parent7792cd8885954eb7ac38e781a7a9faae5a80a3d8 (diff)
[CCID2]: Replace read-only variable with constant
This replaces the field member `numdupack', which was used as a read-only constant in the code, with a #define. Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk> Signed-off-by: Ian McDonald <ian.mcdonald@jandi.co.nz> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp/ccids')
-rw-r--r--net/dccp/ccids/ccid2.c8
-rw-r--r--net/dccp/ccids/ccid2.h3
2 files changed, 5 insertions, 6 deletions
diff --git a/net/dccp/ccids/ccid2.c b/net/dccp/ccids/ccid2.c
index 9fa0eb5f691b..a3c42cd00b00 100644
--- a/net/dccp/ccids/ccid2.c
+++ b/net/dccp/ccids/ccid2.c
@@ -586,8 +586,7 @@ static void ccid2_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
586 hctx->ccid2hctx_rpdupack++; 586 hctx->ccid2hctx_rpdupack++;
587 587
588 /* check if we got enough dupacks */ 588 /* check if we got enough dupacks */
589 if (hctx->ccid2hctx_rpdupack >= 589 if (hctx->ccid2hctx_rpdupack >= NUMDUPACK) {
590 hctx->ccid2hctx_numdupack) {
591 hctx->ccid2hctx_rpdupack = -1; /* XXX lame */ 590 hctx->ccid2hctx_rpdupack = -1; /* XXX lame */
592 hctx->ccid2hctx_rpseq = 0; 591 hctx->ccid2hctx_rpseq = 0;
593 592
@@ -708,7 +707,7 @@ static void ccid2_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
708 while (1) { 707 while (1) {
709 if (seqp->ccid2s_acked) { 708 if (seqp->ccid2s_acked) {
710 done++; 709 done++;
711 if (done == hctx->ccid2hctx_numdupack) 710 if (done == NUMDUPACK)
712 break; 711 break;
713 } 712 }
714 if (seqp == hctx->ccid2hctx_seqt) 713 if (seqp == hctx->ccid2hctx_seqt)
@@ -719,7 +718,7 @@ static void ccid2_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
719 /* If there are at least 3 acknowledgements, anything unacknowledged 718 /* If there are at least 3 acknowledgements, anything unacknowledged
720 * below the last sequence number is considered lost 719 * below the last sequence number is considered lost
721 */ 720 */
722 if (done == hctx->ccid2hctx_numdupack) { 721 if (done == NUMDUPACK) {
723 struct ccid2_seq *last_acked = seqp; 722 struct ccid2_seq *last_acked = seqp;
724 723
725 /* check for lost packets */ 724 /* check for lost packets */
@@ -761,7 +760,6 @@ static int ccid2_hc_tx_init(struct ccid *ccid, struct sock *sk)
761 760
762 /* RFC 4341, 5: initialise ssthresh to arbitrarily high (max) value */ 761 /* RFC 4341, 5: initialise ssthresh to arbitrarily high (max) value */
763 hctx->ccid2hctx_ssthresh = ~0; 762 hctx->ccid2hctx_ssthresh = ~0;
764 hctx->ccid2hctx_numdupack = 3;
765 763
766 /* 764 /*
767 * RFC 4341, 5: "The cwnd parameter is initialized to at most four 765 * RFC 4341, 5: "The cwnd parameter is initialized to at most four
diff --git a/net/dccp/ccids/ccid2.h b/net/dccp/ccids/ccid2.h
index 6d0b4e32b161..443f08a667a2 100644
--- a/net/dccp/ccids/ccid2.h
+++ b/net/dccp/ccids/ccid2.h
@@ -24,6 +24,8 @@
24#include <linux/timer.h> 24#include <linux/timer.h>
25#include <linux/types.h> 25#include <linux/types.h>
26#include "../ccid.h" 26#include "../ccid.h"
27/* NUMDUPACK parameter from RFC 4341, p. 6 */
28#define NUMDUPACK 3
27 29
28struct sock; 30struct sock;
29 31
@@ -52,7 +54,6 @@ struct ccid2_hc_tx_sock {
52 int ccid2hctx_acks; 54 int ccid2hctx_acks;
53 unsigned int ccid2hctx_ssthresh; 55 unsigned int ccid2hctx_ssthresh;
54 int ccid2hctx_pipe; 56 int ccid2hctx_pipe;
55 int ccid2hctx_numdupack;
56 struct ccid2_seq *ccid2hctx_seqbuf[CCID2_SEQBUF_MAX]; 57 struct ccid2_seq *ccid2hctx_seqbuf[CCID2_SEQBUF_MAX];
57 int ccid2hctx_seqbufc; 58 int ccid2hctx_seqbufc;
58 struct ccid2_seq *ccid2hctx_seqh; 59 struct ccid2_seq *ccid2hctx_seqh;