diff options
author | Gerrit Renker <gerrit@erg.abdn.ac.uk> | 2008-09-04 01:30:19 -0400 |
---|---|---|
committer | Gerrit Renker <gerrit@erg.abdn.ac.uk> | 2008-09-04 01:45:32 -0400 |
commit | 51c7d4fa2675c106a980ddcdbe308b54b5151945 (patch) | |
tree | 0c1f2b1a3323582fb8629ba7826e08710271ed49 /net/dccp/dccp.h | |
parent | 09856c108956c99088ead9267ccbd1dab77f7043 (diff) |
dccp: Implement both feature-local and feature-remote Sequence Window feature
This adds full support for local/remote Sequence Window feature, from which the
* sequence-number-validity (W) and
* acknowledgment-number-validity (W') windows
derive as specified in RFC 4340, 7.5.3.
Specifically, the following changes are introduced:
* integrated new socket fields into dccp_sk;
* updated the update_gsr/gss routines with regard to these fields;
* updated handler code: the Sequence Window feature is located at the TX side,
so the local feature is meant if the handler-rx flag is false;
* the initialisation of `rcv_wnd' in reqsk is removed, since
- rcv_wnd is not used by the code anywhere;
- sequence number checks are not done in the LISTEN state (cf. 7.5.3);
- dccp_check_req checks the Ack number validity more rigorously;
* the `struct dccp_minisock' became empty and is now removed.
Until the handshake completes with activating negotiated values, the local/remote
Sequence-Window values are undefined and thus can not reliably be estimated.
This issue is addressed in a separate patch.
Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Acked-by: Ian McDonald <ian.mcdonald@jandi.co.nz>
Diffstat (limited to 'net/dccp/dccp.h')
-rw-r--r-- | net/dccp/dccp.h | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/net/dccp/dccp.h b/net/dccp/dccp.h index 3fd16e82c003..6101ecdb85b6 100644 --- a/net/dccp/dccp.h +++ b/net/dccp/dccp.h | |||
@@ -409,23 +409,21 @@ static inline void dccp_hdr_set_ack(struct dccp_hdr_ack_bits *dhack, | |||
409 | static inline void dccp_update_gsr(struct sock *sk, u64 seq) | 409 | static inline void dccp_update_gsr(struct sock *sk, u64 seq) |
410 | { | 410 | { |
411 | struct dccp_sock *dp = dccp_sk(sk); | 411 | struct dccp_sock *dp = dccp_sk(sk); |
412 | const struct dccp_minisock *dmsk = dccp_msk(sk); | ||
413 | 412 | ||
414 | dp->dccps_gsr = seq; | 413 | dp->dccps_gsr = seq; |
415 | dccp_set_seqno(&dp->dccps_swl, | 414 | /* Sequence validity window depends on remote Sequence Window (7.5.1) */ |
416 | dp->dccps_gsr + 1 - (dmsk->dccpms_sequence_window / 4)); | 415 | dp->dccps_swl = SUB48(ADD48(dp->dccps_gsr, 1), dp->dccps_r_seq_win / 4); |
417 | dccp_set_seqno(&dp->dccps_swh, | 416 | dp->dccps_swh = ADD48(dp->dccps_gsr, (3 * dp->dccps_r_seq_win) / 4); |
418 | dp->dccps_gsr + (3 * dmsk->dccpms_sequence_window) / 4); | ||
419 | } | 417 | } |
420 | 418 | ||
421 | static inline void dccp_update_gss(struct sock *sk, u64 seq) | 419 | static inline void dccp_update_gss(struct sock *sk, u64 seq) |
422 | { | 420 | { |
423 | struct dccp_sock *dp = dccp_sk(sk); | 421 | struct dccp_sock *dp = dccp_sk(sk); |
424 | 422 | ||
425 | dp->dccps_awh = dp->dccps_gss = seq; | 423 | dp->dccps_gss = seq; |
426 | dccp_set_seqno(&dp->dccps_awl, | 424 | /* Ack validity window depends on local Sequence Window value (7.5.1) */ |
427 | (dp->dccps_gss - | 425 | dp->dccps_awl = SUB48(ADD48(dp->dccps_gss, 1), dp->dccps_l_seq_win); |
428 | dccp_msk(sk)->dccpms_sequence_window + 1)); | 426 | dp->dccps_awh = dp->dccps_gss; |
429 | } | 427 | } |
430 | 428 | ||
431 | static inline int dccp_ack_pending(const struct sock *sk) | 429 | static inline int dccp_ack_pending(const struct sock *sk) |