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 | 0a4822679d94e2b0117aeead06a19fad59533905 (patch) | |
tree | a7df5bd77ba005e8b5a2f6be44929470d5916a74 /net/dccp/feat.c | |
parent | 51c7d4fa2675c106a980ddcdbe308b54b5151945 (diff) |
dccp: Initialisation and type-checking of feature sysctls
This patch takes care of initialising and type-checking sysctls related to
feature negotiation. Type checking is important since some of the sysctls
now directly act on the feature-negotiation process.
The sysctls are initialised with the known default values for each feature.
For the type-checking the value constraints from RFC 4340 are used:
* Sequence Window uses the specified Wmin=32, the maximum is ulong (4 bytes),
tested and confirmed that it works up to 4294967295 - for Gbps speed;
* Ack Ratio is between 0 .. 0xffff (2-byte unsigned integer);
* CCIDs are between 0 .. 255;
* request_retries, retries1, retries2 also between 0..255 for good measure;
* tx_qlen is checked to be non-negative;
* sync_ratelimit remains as before.
Further changes:
----------------
Performed s@sysctl_dccp_feat@sysctl_dccp@g since the sysctls are now in feat.c.
Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Acked-by: Ian McDonald <ian.mcdonald@jandi.co.nz>
Diffstat (limited to 'net/dccp/feat.c')
-rw-r--r-- | net/dccp/feat.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/net/dccp/feat.c b/net/dccp/feat.c index 843465999854..4c95cbdb0e01 100644 --- a/net/dccp/feat.c +++ b/net/dccp/feat.c | |||
@@ -26,6 +26,11 @@ | |||
26 | #include "ccid.h" | 26 | #include "ccid.h" |
27 | #include "feat.h" | 27 | #include "feat.h" |
28 | 28 | ||
29 | /* feature-specific sysctls - initialised to the defaults from RFC 4340, 6.4 */ | ||
30 | unsigned long sysctl_dccp_sequence_window __read_mostly = 100; | ||
31 | int sysctl_dccp_rx_ccid __read_mostly = 2, | ||
32 | sysctl_dccp_tx_ccid __read_mostly = 2; | ||
33 | |||
29 | /* | 34 | /* |
30 | * Feature activation handlers. | 35 | * Feature activation handlers. |
31 | * | 36 | * |
@@ -1141,7 +1146,7 @@ int dccp_feat_init(struct sock *sk) | |||
1141 | 1146 | ||
1142 | /* Non-negotiable (NN) features */ | 1147 | /* Non-negotiable (NN) features */ |
1143 | rc = __feat_register_nn(fn, DCCPF_SEQUENCE_WINDOW, 0, | 1148 | rc = __feat_register_nn(fn, DCCPF_SEQUENCE_WINDOW, 0, |
1144 | sysctl_dccp_feat_sequence_window); | 1149 | sysctl_dccp_sequence_window); |
1145 | if (rc) | 1150 | if (rc) |
1146 | return rc; | 1151 | return rc; |
1147 | 1152 | ||
@@ -1172,8 +1177,8 @@ int dccp_feat_init(struct sock *sk) | |||
1172 | if (ccid_request_modules(tx.val, tx.len)) | 1177 | if (ccid_request_modules(tx.val, tx.len)) |
1173 | goto free_ccid_lists; | 1178 | goto free_ccid_lists; |
1174 | 1179 | ||
1175 | if (!dccp_feat_prefer(sysctl_dccp_feat_tx_ccid, tx.val, tx.len) || | 1180 | if (!dccp_feat_prefer(sysctl_dccp_tx_ccid, tx.val, tx.len) || |
1176 | !dccp_feat_prefer(sysctl_dccp_feat_rx_ccid, rx.val, rx.len)) | 1181 | !dccp_feat_prefer(sysctl_dccp_rx_ccid, rx.val, rx.len)) |
1177 | goto free_ccid_lists; | 1182 | goto free_ccid_lists; |
1178 | 1183 | ||
1179 | rc = __feat_register_sp(fn, DCCPF_CCID, true, false, tx.val, tx.len); | 1184 | rc = __feat_register_sp(fn, DCCPF_CCID, true, false, tx.val, tx.len); |