Commit 63df18ad authored by Gerrit Renker's avatar Gerrit Renker Committed by David S. Miller

[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: default avatarGerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: default avatarIan McDonald <ian.mcdonald@jandi.co.nz>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7792cd88
...@@ -586,8 +586,7 @@ static void ccid2_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb) ...@@ -586,8 +586,7 @@ static void ccid2_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
hctx->ccid2hctx_rpdupack++; hctx->ccid2hctx_rpdupack++;
/* check if we got enough dupacks */ /* check if we got enough dupacks */
if (hctx->ccid2hctx_rpdupack >= if (hctx->ccid2hctx_rpdupack >= NUMDUPACK) {
hctx->ccid2hctx_numdupack) {
hctx->ccid2hctx_rpdupack = -1; /* XXX lame */ hctx->ccid2hctx_rpdupack = -1; /* XXX lame */
hctx->ccid2hctx_rpseq = 0; hctx->ccid2hctx_rpseq = 0;
...@@ -708,7 +707,7 @@ static void ccid2_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb) ...@@ -708,7 +707,7 @@ static void ccid2_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
while (1) { while (1) {
if (seqp->ccid2s_acked) { if (seqp->ccid2s_acked) {
done++; done++;
if (done == hctx->ccid2hctx_numdupack) if (done == NUMDUPACK)
break; break;
} }
if (seqp == hctx->ccid2hctx_seqt) if (seqp == hctx->ccid2hctx_seqt)
...@@ -719,7 +718,7 @@ static void ccid2_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb) ...@@ -719,7 +718,7 @@ static void ccid2_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
/* If there are at least 3 acknowledgements, anything unacknowledged /* If there are at least 3 acknowledgements, anything unacknowledged
* below the last sequence number is considered lost * below the last sequence number is considered lost
*/ */
if (done == hctx->ccid2hctx_numdupack) { if (done == NUMDUPACK) {
struct ccid2_seq *last_acked = seqp; struct ccid2_seq *last_acked = seqp;
/* check for lost packets */ /* check for lost packets */
...@@ -761,7 +760,6 @@ static int ccid2_hc_tx_init(struct ccid *ccid, struct sock *sk) ...@@ -761,7 +760,6 @@ static int ccid2_hc_tx_init(struct ccid *ccid, struct sock *sk)
/* RFC 4341, 5: initialise ssthresh to arbitrarily high (max) value */ /* RFC 4341, 5: initialise ssthresh to arbitrarily high (max) value */
hctx->ccid2hctx_ssthresh = ~0; hctx->ccid2hctx_ssthresh = ~0;
hctx->ccid2hctx_numdupack = 3;
/* /*
* RFC 4341, 5: "The cwnd parameter is initialized to at most four * RFC 4341, 5: "The cwnd parameter is initialized to at most four
......
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
#include <linux/timer.h> #include <linux/timer.h>
#include <linux/types.h> #include <linux/types.h>
#include "../ccid.h" #include "../ccid.h"
/* NUMDUPACK parameter from RFC 4341, p. 6 */
#define NUMDUPACK 3
struct sock; struct sock;
...@@ -52,7 +54,6 @@ struct ccid2_hc_tx_sock { ...@@ -52,7 +54,6 @@ struct ccid2_hc_tx_sock {
int ccid2hctx_acks; int ccid2hctx_acks;
unsigned int ccid2hctx_ssthresh; unsigned int ccid2hctx_ssthresh;
int ccid2hctx_pipe; int ccid2hctx_pipe;
int ccid2hctx_numdupack;
struct ccid2_seq *ccid2hctx_seqbuf[CCID2_SEQBUF_MAX]; struct ccid2_seq *ccid2hctx_seqbuf[CCID2_SEQBUF_MAX];
int ccid2hctx_seqbufc; int ccid2hctx_seqbufc;
struct ccid2_seq *ccid2hctx_seqh; struct ccid2_seq *ccid2hctx_seqh;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment