diff options
author | Gerrit Renker <gerrit@erg.abdn.ac.uk> | 2008-07-13 06:51:40 -0400 |
---|---|---|
committer | Gerrit Renker <gerrit@erg.abdn.ac.uk> | 2008-07-13 06:51:40 -0400 |
commit | 2eeea7ba6b4b65ed27b7646a1bdea3b45973c861 (patch) | |
tree | da60ba323ca324789d42d8c0513be8a26d150832 /net/dccp/ccids | |
parent | b552c6231f19d50165bbf59e8b34d3f713ab5c01 (diff) |
dccp ccid-3: Length of loss intervals
This corrects an error in the computation of the open loss interval I_0:
* the interval length is (highest_seqno - start_seqno) + 1
* and not (highest_seqno - start_seqno).
This condition was not fully clear in RFC 3448, but reflects the current
revision state of rfc3448bis and is also consistent with RFC 4340, 6.1.1.
Further changes:
----------------
* variable renamed due to line length constraints;
* explicit typecast to `s64' to avoid implicit signed/unsigned casting.
Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Diffstat (limited to 'net/dccp/ccids')
-rw-r--r-- | net/dccp/ccids/lib/loss_interval.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/net/dccp/ccids/lib/loss_interval.c b/net/dccp/ccids/lib/loss_interval.c index 849e181e698f..bcd6ac415bb9 100644 --- a/net/dccp/ccids/lib/loss_interval.c +++ b/net/dccp/ccids/lib/loss_interval.c | |||
@@ -90,14 +90,14 @@ u8 tfrc_lh_update_i_mean(struct tfrc_loss_hist *lh, struct sk_buff *skb) | |||
90 | { | 90 | { |
91 | struct tfrc_loss_interval *cur = tfrc_lh_peek(lh); | 91 | struct tfrc_loss_interval *cur = tfrc_lh_peek(lh); |
92 | u32 old_i_mean = lh->i_mean; | 92 | u32 old_i_mean = lh->i_mean; |
93 | s64 length; | 93 | s64 len; |
94 | 94 | ||
95 | if (cur == NULL) /* not initialised */ | 95 | if (cur == NULL) /* not initialised */ |
96 | return 0; | 96 | return 0; |
97 | 97 | ||
98 | length = dccp_delta_seqno(cur->li_seqno, DCCP_SKB_CB(skb)->dccpd_seq); | 98 | len = dccp_delta_seqno(cur->li_seqno, DCCP_SKB_CB(skb)->dccpd_seq) + 1; |
99 | 99 | ||
100 | if (length - cur->li_length <= 0) /* duplicate or reordered */ | 100 | if (len - (s64)cur->li_length <= 0) /* duplicate or reordered */ |
101 | return 0; | 101 | return 0; |
102 | 102 | ||
103 | if (SUB16(dccp_hdr(skb)->dccph_ccval, cur->li_ccval) > 4) | 103 | if (SUB16(dccp_hdr(skb)->dccph_ccval, cur->li_ccval) > 4) |
@@ -114,7 +114,7 @@ u8 tfrc_lh_update_i_mean(struct tfrc_loss_hist *lh, struct sk_buff *skb) | |||
114 | if (tfrc_lh_length(lh) == 1) /* due to RFC 3448, 6.3.1 */ | 114 | if (tfrc_lh_length(lh) == 1) /* due to RFC 3448, 6.3.1 */ |
115 | return 0; | 115 | return 0; |
116 | 116 | ||
117 | cur->li_length = length; | 117 | cur->li_length = len; |
118 | tfrc_lh_calc_i_mean(lh); | 118 | tfrc_lh_calc_i_mean(lh); |
119 | 119 | ||
120 | return (lh->i_mean < old_i_mean); | 120 | return (lh->i_mean < old_i_mean); |
@@ -159,7 +159,7 @@ int tfrc_lh_interval_add(struct tfrc_loss_hist *lh, struct tfrc_rx_hist *rh, | |||
159 | else { | 159 | else { |
160 | cur->li_length = dccp_delta_seqno(cur->li_seqno, new->li_seqno); | 160 | cur->li_length = dccp_delta_seqno(cur->li_seqno, new->li_seqno); |
161 | new->li_length = dccp_delta_seqno(new->li_seqno, | 161 | new->li_length = dccp_delta_seqno(new->li_seqno, |
162 | tfrc_rx_hist_last_rcv(rh)->tfrchrx_seqno); | 162 | tfrc_rx_hist_last_rcv(rh)->tfrchrx_seqno) + 1; |
163 | if (lh->counter > (2*LIH_SIZE)) | 163 | if (lh->counter > (2*LIH_SIZE)) |
164 | lh->counter -= LIH_SIZE; | 164 | lh->counter -= LIH_SIZE; |
165 | 165 | ||