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:28 -0400 |
commit | fade756f18d42694e3acb00e3471ab43002cba16 (patch) | |
tree | f2ae912af9678315b672eb292ef17de42a97fbf3 /net/dccp/ackvec.c | |
parent | 73bbe095bbb9ce5f94d5475bad54c7ccd8573b1b (diff) |
dccp: Set per-connection CCIDs via socket options
With this patch, TX/RX CCIDs can now be changed on a per-connection basis, which
overrides the defaults set by the global sysctl variables for TX/RX CCIDs.
To make full use of this facility, the remaining patches of this patch set are
needed, which track dependencies and activate negotiated feature values.
Note on the maximum number of CCIDs that can be registered:
-----------------------------------------------------------
The maximum number of CCIDs that can be registered on the socket is constrained
by the space in a Confirm/Change feature negotiation option.
The space in these in turn depends on the size of header options as defined
in RFC 4340, 5.8. Since this is a recurring constant, it has been moved from
ackvec.h into linux/dccp.h, clarifying its purpose.
Relative to this size, the maximum number of CCID identifiers that can be
present in a Confirm option (which always consumes 1 byte more than a Change
option, cf. 6.1) is 2 bytes less than the maximum TLV size: one for the
CCID-feature-type and one for the selected value.
Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Diffstat (limited to 'net/dccp/ackvec.c')
-rw-r--r-- | net/dccp/ackvec.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/net/dccp/ackvec.c b/net/dccp/ackvec.c index 1e8be246ad15..01e4d39fa232 100644 --- a/net/dccp/ackvec.c +++ b/net/dccp/ackvec.c | |||
@@ -12,7 +12,6 @@ | |||
12 | #include "ackvec.h" | 12 | #include "ackvec.h" |
13 | #include "dccp.h" | 13 | #include "dccp.h" |
14 | 14 | ||
15 | #include <linux/dccp.h> | ||
16 | #include <linux/init.h> | 15 | #include <linux/init.h> |
17 | #include <linux/errno.h> | 16 | #include <linux/errno.h> |
18 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
@@ -68,7 +67,7 @@ int dccp_insert_option_ackvec(struct sock *sk, struct sk_buff *skb) | |||
68 | struct dccp_sock *dp = dccp_sk(sk); | 67 | struct dccp_sock *dp = dccp_sk(sk); |
69 | struct dccp_ackvec *av = dp->dccps_hc_rx_ackvec; | 68 | struct dccp_ackvec *av = dp->dccps_hc_rx_ackvec; |
70 | /* Figure out how many options do we need to represent the ackvec */ | 69 | /* Figure out how many options do we need to represent the ackvec */ |
71 | const u16 nr_opts = DIV_ROUND_UP(av->av_vec_len, DCCP_MAX_ACKVEC_OPT_LEN); | 70 | const u8 nr_opts = DIV_ROUND_UP(av->av_vec_len, DCCP_SINGLE_OPT_MAXLEN); |
72 | u16 len = av->av_vec_len + 2 * nr_opts, i; | 71 | u16 len = av->av_vec_len + 2 * nr_opts, i; |
73 | u32 elapsed_time; | 72 | u32 elapsed_time; |
74 | const unsigned char *tail, *from; | 73 | const unsigned char *tail, *from; |
@@ -100,8 +99,8 @@ int dccp_insert_option_ackvec(struct sock *sk, struct sk_buff *skb) | |||
100 | for (i = 0; i < nr_opts; ++i) { | 99 | for (i = 0; i < nr_opts; ++i) { |
101 | int copylen = len; | 100 | int copylen = len; |
102 | 101 | ||
103 | if (len > DCCP_MAX_ACKVEC_OPT_LEN) | 102 | if (len > DCCP_SINGLE_OPT_MAXLEN) |
104 | copylen = DCCP_MAX_ACKVEC_OPT_LEN; | 103 | copylen = DCCP_SINGLE_OPT_MAXLEN; |
105 | 104 | ||
106 | *to++ = DCCPO_ACK_VECTOR_0; | 105 | *to++ = DCCPO_ACK_VECTOR_0; |
107 | *to++ = copylen + 2; | 106 | *to++ = copylen + 2; |
@@ -432,7 +431,7 @@ found: | |||
432 | int dccp_ackvec_parse(struct sock *sk, const struct sk_buff *skb, | 431 | int dccp_ackvec_parse(struct sock *sk, const struct sk_buff *skb, |
433 | u64 *ackno, const u8 opt, const u8 *value, const u8 len) | 432 | u64 *ackno, const u8 opt, const u8 *value, const u8 len) |
434 | { | 433 | { |
435 | if (len > DCCP_MAX_ACKVEC_OPT_LEN) | 434 | if (len > DCCP_SINGLE_OPT_MAXLEN) |
436 | return -1; | 435 | return -1; |
437 | 436 | ||
438 | /* dccp_ackvector_print(DCCP_SKB_CB(skb)->dccpd_ack_seq, value, len); */ | 437 | /* dccp_ackvector_print(DCCP_SKB_CB(skb)->dccpd_ack_seq, value, len); */ |