diff options
Diffstat (limited to 'net/dccp')
-rw-r--r-- | net/dccp/dccp.h | 11 | ||||
-rw-r--r-- | net/dccp/diag.c | 2 | ||||
-rw-r--r-- | net/dccp/feat.c | 81 | ||||
-rw-r--r-- | net/dccp/input.c | 8 | ||||
-rw-r--r-- | net/dccp/minisocks.c | 9 | ||||
-rw-r--r-- | net/dccp/options.c | 30 | ||||
-rw-r--r-- | net/dccp/proto.c | 23 |
7 files changed, 78 insertions, 86 deletions
diff --git a/net/dccp/dccp.h b/net/dccp/dccp.h index 47de17208d7a..1fe509148689 100644 --- a/net/dccp/dccp.h +++ b/net/dccp/dccp.h | |||
@@ -303,14 +303,13 @@ static inline void dccp_hdr_set_ack(struct dccp_hdr_ack_bits *dhack, | |||
303 | static inline void dccp_update_gsr(struct sock *sk, u64 seq) | 303 | static inline void dccp_update_gsr(struct sock *sk, u64 seq) |
304 | { | 304 | { |
305 | struct dccp_sock *dp = dccp_sk(sk); | 305 | struct dccp_sock *dp = dccp_sk(sk); |
306 | const struct dccp_minisock *dmsk = dccp_msk(sk); | ||
306 | 307 | ||
307 | dp->dccps_gsr = seq; | 308 | dp->dccps_gsr = seq; |
308 | dccp_set_seqno(&dp->dccps_swl, | 309 | dccp_set_seqno(&dp->dccps_swl, |
309 | (dp->dccps_gsr + 1 - | 310 | dp->dccps_gsr + 1 - (dmsk->dccpms_sequence_window / 4)); |
310 | (dp->dccps_options.dccpo_sequence_window / 4))); | ||
311 | dccp_set_seqno(&dp->dccps_swh, | 311 | dccp_set_seqno(&dp->dccps_swh, |
312 | (dp->dccps_gsr + | 312 | dp->dccps_gsr + (3 * dmsk->dccpms_sequence_window) / 4); |
313 | (3 * dp->dccps_options.dccpo_sequence_window) / 4)); | ||
314 | } | 313 | } |
315 | 314 | ||
316 | static inline void dccp_update_gss(struct sock *sk, u64 seq) | 315 | static inline void dccp_update_gss(struct sock *sk, u64 seq) |
@@ -320,7 +319,7 @@ static inline void dccp_update_gss(struct sock *sk, u64 seq) | |||
320 | dp->dccps_awh = dp->dccps_gss = seq; | 319 | dp->dccps_awh = dp->dccps_gss = seq; |
321 | dccp_set_seqno(&dp->dccps_awl, | 320 | dccp_set_seqno(&dp->dccps_awl, |
322 | (dp->dccps_gss - | 321 | (dp->dccps_gss - |
323 | dp->dccps_options.dccpo_sequence_window + 1)); | 322 | dccp_msk(sk)->dccpms_sequence_window + 1)); |
324 | } | 323 | } |
325 | 324 | ||
326 | static inline int dccp_ack_pending(const struct sock *sk) | 325 | static inline int dccp_ack_pending(const struct sock *sk) |
@@ -328,7 +327,7 @@ static inline int dccp_ack_pending(const struct sock *sk) | |||
328 | const struct dccp_sock *dp = dccp_sk(sk); | 327 | const struct dccp_sock *dp = dccp_sk(sk); |
329 | return dp->dccps_timestamp_echo != 0 || | 328 | return dp->dccps_timestamp_echo != 0 || |
330 | #ifdef CONFIG_IP_DCCP_ACKVEC | 329 | #ifdef CONFIG_IP_DCCP_ACKVEC |
331 | (dp->dccps_options.dccpo_send_ack_vector && | 330 | (dccp_msk(sk)->dccpms_send_ack_vector && |
332 | dccp_ackvec_pending(dp->dccps_hc_rx_ackvec)) || | 331 | dccp_ackvec_pending(dp->dccps_hc_rx_ackvec)) || |
333 | #endif | 332 | #endif |
334 | inet_csk_ack_scheduled(sk); | 333 | inet_csk_ack_scheduled(sk); |
diff --git a/net/dccp/diag.c b/net/dccp/diag.c index 3f78c00e3822..0f25dc395967 100644 --- a/net/dccp/diag.c +++ b/net/dccp/diag.c | |||
@@ -30,7 +30,7 @@ static void dccp_get_info(struct sock *sk, struct tcp_info *info) | |||
30 | info->tcpi_backoff = icsk->icsk_backoff; | 30 | info->tcpi_backoff = icsk->icsk_backoff; |
31 | info->tcpi_pmtu = icsk->icsk_pmtu_cookie; | 31 | info->tcpi_pmtu = icsk->icsk_pmtu_cookie; |
32 | 32 | ||
33 | if (dp->dccps_options.dccpo_send_ack_vector) | 33 | if (dccp_msk(sk)->dccpms_send_ack_vector) |
34 | info->tcpi_options |= TCPI_OPT_SACK; | 34 | info->tcpi_options |= TCPI_OPT_SACK; |
35 | 35 | ||
36 | ccid_hc_rx_get_info(dp->dccps_hc_rx_ccid, sk, info); | 36 | ccid_hc_rx_get_info(dp->dccps_hc_rx_ccid, sk, info); |
diff --git a/net/dccp/feat.c b/net/dccp/feat.c index ed0851fa3cb3..b09064c4643d 100644 --- a/net/dccp/feat.c +++ b/net/dccp/feat.c | |||
@@ -22,7 +22,7 @@ | |||
22 | int dccp_feat_change(struct sock *sk, u8 type, u8 feature, u8 *val, u8 len, | 22 | int dccp_feat_change(struct sock *sk, u8 type, u8 feature, u8 *val, u8 len, |
23 | gfp_t gfp) | 23 | gfp_t gfp) |
24 | { | 24 | { |
25 | struct dccp_sock *dp = dccp_sk(sk); | 25 | struct dccp_minisock *dmsk = dccp_msk(sk); |
26 | struct dccp_opt_pend *opt; | 26 | struct dccp_opt_pend *opt; |
27 | 27 | ||
28 | dccp_pr_debug("feat change type=%d feat=%d\n", type, feature); | 28 | dccp_pr_debug("feat change type=%d feat=%d\n", type, feature); |
@@ -30,8 +30,7 @@ int dccp_feat_change(struct sock *sk, u8 type, u8 feature, u8 *val, u8 len, | |||
30 | /* XXX sanity check feat change request */ | 30 | /* XXX sanity check feat change request */ |
31 | 31 | ||
32 | /* check if that feature is already being negotiated */ | 32 | /* check if that feature is already being negotiated */ |
33 | list_for_each_entry(opt, &dp->dccps_options.dccpo_pending, | 33 | list_for_each_entry(opt, &dmsk->dccpms_pending, dccpop_node) { |
34 | dccpop_node) { | ||
35 | /* ok we found a negotiation for this option already */ | 34 | /* ok we found a negotiation for this option already */ |
36 | if (opt->dccpop_feat == feature && opt->dccpop_type == type) { | 35 | if (opt->dccpop_feat == feature && opt->dccpop_type == type) { |
37 | dccp_pr_debug("Replacing old\n"); | 36 | dccp_pr_debug("Replacing old\n"); |
@@ -59,7 +58,7 @@ int dccp_feat_change(struct sock *sk, u8 type, u8 feature, u8 *val, u8 len, | |||
59 | 58 | ||
60 | BUG_ON(opt->dccpop_val == NULL); | 59 | BUG_ON(opt->dccpop_val == NULL); |
61 | 60 | ||
62 | list_add_tail(&opt->dccpop_node, &dp->dccps_options.dccpo_pending); | 61 | list_add_tail(&opt->dccpop_node, &dmsk->dccpms_pending); |
63 | return 0; | 62 | return 0; |
64 | } | 63 | } |
65 | 64 | ||
@@ -68,10 +67,10 @@ EXPORT_SYMBOL_GPL(dccp_feat_change); | |||
68 | static int dccp_feat_update_ccid(struct sock *sk, u8 type, u8 new_ccid_nr) | 67 | static int dccp_feat_update_ccid(struct sock *sk, u8 type, u8 new_ccid_nr) |
69 | { | 68 | { |
70 | struct dccp_sock *dp = dccp_sk(sk); | 69 | struct dccp_sock *dp = dccp_sk(sk); |
70 | struct dccp_minisock *dmsk = dccp_msk(sk); | ||
71 | /* figure out if we are changing our CCID or the peer's */ | 71 | /* figure out if we are changing our CCID or the peer's */ |
72 | const int rx = type == DCCPO_CHANGE_R; | 72 | const int rx = type == DCCPO_CHANGE_R; |
73 | const u8 ccid_nr = rx ? dp->dccps_options.dccpo_rx_ccid : | 73 | const u8 ccid_nr = rx ? dmsk->dccpms_rx_ccid : dmsk->dccpms_tx_ccid; |
74 | dp->dccps_options.dccpo_tx_ccid; | ||
75 | struct ccid *new_ccid; | 74 | struct ccid *new_ccid; |
76 | 75 | ||
77 | /* Check if nothing is being changed. */ | 76 | /* Check if nothing is being changed. */ |
@@ -85,11 +84,11 @@ static int dccp_feat_update_ccid(struct sock *sk, u8 type, u8 new_ccid_nr) | |||
85 | if (rx) { | 84 | if (rx) { |
86 | ccid_hc_rx_delete(dp->dccps_hc_rx_ccid, sk); | 85 | ccid_hc_rx_delete(dp->dccps_hc_rx_ccid, sk); |
87 | dp->dccps_hc_rx_ccid = new_ccid; | 86 | dp->dccps_hc_rx_ccid = new_ccid; |
88 | dp->dccps_options.dccpo_rx_ccid = new_ccid_nr; | 87 | dmsk->dccpms_rx_ccid = new_ccid_nr; |
89 | } else { | 88 | } else { |
90 | ccid_hc_tx_delete(dp->dccps_hc_tx_ccid, sk); | 89 | ccid_hc_tx_delete(dp->dccps_hc_tx_ccid, sk); |
91 | dp->dccps_hc_tx_ccid = new_ccid; | 90 | dp->dccps_hc_tx_ccid = new_ccid; |
92 | dp->dccps_options.dccpo_tx_ccid = new_ccid_nr; | 91 | dmsk->dccpms_tx_ccid = new_ccid_nr; |
93 | } | 92 | } |
94 | 93 | ||
95 | return 0; | 94 | return 0; |
@@ -159,9 +158,9 @@ static int dccp_feat_reconcile(struct sock *sk, struct dccp_opt_pend *opt, | |||
159 | case DCCPF_CCID: | 158 | case DCCPF_CCID: |
160 | /* XXX did i get this right? =P */ | 159 | /* XXX did i get this right? =P */ |
161 | if (opt->dccpop_type == DCCPO_CHANGE_L) | 160 | if (opt->dccpop_type == DCCPO_CHANGE_L) |
162 | res = &dp->dccps_options.dccpo_tx_ccid; | 161 | res = &dccp_msk(sk)->dccpms_tx_ccid; |
163 | else | 162 | else |
164 | res = &dp->dccps_options.dccpo_rx_ccid; | 163 | res = &dccp_msk(sk)->dccpms_rx_ccid; |
165 | break; | 164 | break; |
166 | 165 | ||
167 | default: | 166 | default: |
@@ -226,7 +225,7 @@ static int dccp_feat_reconcile(struct sock *sk, struct dccp_opt_pend *opt, | |||
226 | 225 | ||
227 | static int dccp_feat_sp(struct sock *sk, u8 type, u8 feature, u8 *val, u8 len) | 226 | static int dccp_feat_sp(struct sock *sk, u8 type, u8 feature, u8 *val, u8 len) |
228 | { | 227 | { |
229 | struct dccp_sock *dp = dccp_sk(sk); | 228 | struct dccp_minisock *dmsk = dccp_msk(sk); |
230 | struct dccp_opt_pend *opt; | 229 | struct dccp_opt_pend *opt; |
231 | int rc = 1; | 230 | int rc = 1; |
232 | u8 t; | 231 | u8 t; |
@@ -242,8 +241,7 @@ static int dccp_feat_sp(struct sock *sk, u8 type, u8 feature, u8 *val, u8 len) | |||
242 | t = DCCPO_CHANGE_L; | 241 | t = DCCPO_CHANGE_L; |
243 | 242 | ||
244 | /* find our preference list for this feature */ | 243 | /* find our preference list for this feature */ |
245 | list_for_each_entry(opt, &dp->dccps_options.dccpo_pending, | 244 | list_for_each_entry(opt, &dmsk->dccpms_pending, dccpop_node) { |
246 | dccpop_node) { | ||
247 | if (opt->dccpop_type != t || opt->dccpop_feat != feature) | 245 | if (opt->dccpop_type != t || opt->dccpop_feat != feature) |
248 | continue; | 246 | continue; |
249 | 247 | ||
@@ -265,7 +263,7 @@ static int dccp_feat_sp(struct sock *sk, u8 type, u8 feature, u8 *val, u8 len) | |||
265 | static int dccp_feat_nn(struct sock *sk, u8 type, u8 feature, u8 *val, u8 len) | 263 | static int dccp_feat_nn(struct sock *sk, u8 type, u8 feature, u8 *val, u8 len) |
266 | { | 264 | { |
267 | struct dccp_opt_pend *opt; | 265 | struct dccp_opt_pend *opt; |
268 | struct dccp_sock *dp = dccp_sk(sk); | 266 | struct dccp_minisock *dmsk = dccp_msk(sk); |
269 | u8 *copy; | 267 | u8 *copy; |
270 | int rc; | 268 | int rc; |
271 | 269 | ||
@@ -304,14 +302,14 @@ static int dccp_feat_nn(struct sock *sk, u8 type, u8 feature, u8 *val, u8 len) | |||
304 | } | 302 | } |
305 | 303 | ||
306 | dccp_pr_debug("Confirming NN feature %d (val=%d)\n", feature, *copy); | 304 | dccp_pr_debug("Confirming NN feature %d (val=%d)\n", feature, *copy); |
307 | list_add_tail(&opt->dccpop_node, &dp->dccps_options.dccpo_conf); | 305 | list_add_tail(&opt->dccpop_node, &dmsk->dccpms_conf); |
308 | 306 | ||
309 | return 0; | 307 | return 0; |
310 | } | 308 | } |
311 | 309 | ||
312 | static void dccp_feat_empty_confirm(struct sock *sk, u8 type, u8 feature) | 310 | static void dccp_feat_empty_confirm(struct sock *sk, u8 type, u8 feature) |
313 | { | 311 | { |
314 | struct dccp_sock *dp = dccp_sk(sk); | 312 | struct dccp_minisock *dmsk = dccp_msk(sk); |
315 | /* XXX check if other confirms for that are queued and recycle slot */ | 313 | /* XXX check if other confirms for that are queued and recycle slot */ |
316 | struct dccp_opt_pend *opt = kzalloc(sizeof(*opt), GFP_ATOMIC); | 314 | struct dccp_opt_pend *opt = kzalloc(sizeof(*opt), GFP_ATOMIC); |
317 | 315 | ||
@@ -330,20 +328,19 @@ static void dccp_feat_empty_confirm(struct sock *sk, u8 type, u8 feature) | |||
330 | 328 | ||
331 | /* change feature */ | 329 | /* change feature */ |
332 | dccp_pr_debug("Empty confirm feature %d type %d\n", feature, type); | 330 | dccp_pr_debug("Empty confirm feature %d type %d\n", feature, type); |
333 | list_add_tail(&opt->dccpop_node, &dp->dccps_options.dccpo_conf); | 331 | list_add_tail(&opt->dccpop_node, &dmsk->dccpms_conf); |
334 | } | 332 | } |
335 | 333 | ||
336 | static void dccp_feat_flush_confirm(struct sock *sk) | 334 | static void dccp_feat_flush_confirm(struct sock *sk) |
337 | { | 335 | { |
338 | struct dccp_sock *dp = dccp_sk(sk); | 336 | struct dccp_minisock *dmsk = dccp_msk(sk); |
339 | /* Check if there is anything to confirm in the first place */ | 337 | /* Check if there is anything to confirm in the first place */ |
340 | int yes = !list_empty(&dp->dccps_options.dccpo_conf); | 338 | int yes = !list_empty(&dmsk->dccpms_conf); |
341 | 339 | ||
342 | if (!yes) { | 340 | if (!yes) { |
343 | struct dccp_opt_pend *opt; | 341 | struct dccp_opt_pend *opt; |
344 | 342 | ||
345 | list_for_each_entry(opt, &dp->dccps_options.dccpo_pending, | 343 | list_for_each_entry(opt, &dmsk->dccpms_pending, dccpop_node) { |
346 | dccpop_node) { | ||
347 | if (opt->dccpop_conf) { | 344 | if (opt->dccpop_conf) { |
348 | yes = 1; | 345 | yes = 1; |
349 | break; | 346 | break; |
@@ -407,7 +404,7 @@ int dccp_feat_confirm_recv(struct sock *sk, u8 type, u8 feature, | |||
407 | { | 404 | { |
408 | u8 t; | 405 | u8 t; |
409 | struct dccp_opt_pend *opt; | 406 | struct dccp_opt_pend *opt; |
410 | struct dccp_sock *dp = dccp_sk(sk); | 407 | struct dccp_minisock *dmsk = dccp_msk(sk); |
411 | int rc = 1; | 408 | int rc = 1; |
412 | int all_confirmed = 1; | 409 | int all_confirmed = 1; |
413 | 410 | ||
@@ -418,8 +415,7 @@ int dccp_feat_confirm_recv(struct sock *sk, u8 type, u8 feature, | |||
418 | /* locate our change request */ | 415 | /* locate our change request */ |
419 | t = type == DCCPO_CONFIRM_L ? DCCPO_CHANGE_R : DCCPO_CHANGE_L; | 416 | t = type == DCCPO_CONFIRM_L ? DCCPO_CHANGE_R : DCCPO_CHANGE_L; |
420 | 417 | ||
421 | list_for_each_entry(opt, &dp->dccps_options.dccpo_pending, | 418 | list_for_each_entry(opt, &dmsk->dccpms_pending, dccpop_node) { |
422 | dccpop_node) { | ||
423 | if (!opt->dccpop_conf && opt->dccpop_type == t && | 419 | if (!opt->dccpop_conf && opt->dccpop_type == t && |
424 | opt->dccpop_feat == feature) { | 420 | opt->dccpop_feat == feature) { |
425 | /* we found it */ | 421 | /* we found it */ |
@@ -462,10 +458,10 @@ EXPORT_SYMBOL_GPL(dccp_feat_confirm_recv); | |||
462 | 458 | ||
463 | void dccp_feat_clean(struct sock *sk) | 459 | void dccp_feat_clean(struct sock *sk) |
464 | { | 460 | { |
465 | struct dccp_sock *dp = dccp_sk(sk); | 461 | struct dccp_minisock *dmsk = dccp_msk(sk); |
466 | struct dccp_opt_pend *opt, *next; | 462 | struct dccp_opt_pend *opt, *next; |
467 | 463 | ||
468 | list_for_each_entry_safe(opt, next, &dp->dccps_options.dccpo_pending, | 464 | list_for_each_entry_safe(opt, next, &dmsk->dccpms_pending, |
469 | dccpop_node) { | 465 | dccpop_node) { |
470 | BUG_ON(opt->dccpop_val == NULL); | 466 | BUG_ON(opt->dccpop_val == NULL); |
471 | kfree(opt->dccpop_val); | 467 | kfree(opt->dccpop_val); |
@@ -478,16 +474,15 @@ void dccp_feat_clean(struct sock *sk) | |||
478 | 474 | ||
479 | kfree(opt); | 475 | kfree(opt); |
480 | } | 476 | } |
481 | INIT_LIST_HEAD(&dp->dccps_options.dccpo_pending); | 477 | INIT_LIST_HEAD(&dmsk->dccpms_pending); |
482 | 478 | ||
483 | list_for_each_entry_safe(opt, next, &dp->dccps_options.dccpo_conf, | 479 | list_for_each_entry_safe(opt, next, &dmsk->dccpms_conf, dccpop_node) { |
484 | dccpop_node) { | ||
485 | BUG_ON(opt == NULL); | 480 | BUG_ON(opt == NULL); |
486 | if (opt->dccpop_val != NULL) | 481 | if (opt->dccpop_val != NULL) |
487 | kfree(opt->dccpop_val); | 482 | kfree(opt->dccpop_val); |
488 | kfree(opt); | 483 | kfree(opt); |
489 | } | 484 | } |
490 | INIT_LIST_HEAD(&dp->dccps_options.dccpo_conf); | 485 | INIT_LIST_HEAD(&dmsk->dccpms_conf); |
491 | } | 486 | } |
492 | 487 | ||
493 | EXPORT_SYMBOL_GPL(dccp_feat_clean); | 488 | EXPORT_SYMBOL_GPL(dccp_feat_clean); |
@@ -498,16 +493,15 @@ EXPORT_SYMBOL_GPL(dccp_feat_clean); | |||
498 | */ | 493 | */ |
499 | int dccp_feat_clone(struct sock *oldsk, struct sock *newsk) | 494 | int dccp_feat_clone(struct sock *oldsk, struct sock *newsk) |
500 | { | 495 | { |
501 | struct dccp_sock *olddp = dccp_sk(oldsk); | 496 | struct dccp_minisock *olddmsk = dccp_msk(oldsk); |
502 | struct dccp_sock *newdp = dccp_sk(newsk); | 497 | struct dccp_minisock *newdmsk = dccp_msk(newsk); |
503 | struct dccp_opt_pend *opt; | 498 | struct dccp_opt_pend *opt; |
504 | int rc = 0; | 499 | int rc = 0; |
505 | 500 | ||
506 | INIT_LIST_HEAD(&newdp->dccps_options.dccpo_pending); | 501 | INIT_LIST_HEAD(&newdmsk->dccpms_pending); |
507 | INIT_LIST_HEAD(&newdp->dccps_options.dccpo_conf); | 502 | INIT_LIST_HEAD(&newdmsk->dccpms_conf); |
508 | 503 | ||
509 | list_for_each_entry(opt, &olddp->dccps_options.dccpo_pending, | 504 | list_for_each_entry(opt, &olddmsk->dccpms_pending, dccpop_node) { |
510 | dccpop_node) { | ||
511 | struct dccp_opt_pend *newopt; | 505 | struct dccp_opt_pend *newopt; |
512 | /* copy the value of the option */ | 506 | /* copy the value of the option */ |
513 | u8 *val = kmalloc(opt->dccpop_len, GFP_ATOMIC); | 507 | u8 *val = kmalloc(opt->dccpop_len, GFP_ATOMIC); |
@@ -525,8 +519,7 @@ int dccp_feat_clone(struct sock *oldsk, struct sock *newsk) | |||
525 | /* insert the option */ | 519 | /* insert the option */ |
526 | memcpy(newopt, opt, sizeof(*newopt)); | 520 | memcpy(newopt, opt, sizeof(*newopt)); |
527 | newopt->dccpop_val = val; | 521 | newopt->dccpop_val = val; |
528 | list_add_tail(&newopt->dccpop_node, | 522 | list_add_tail(&newopt->dccpop_node, &newdmsk->dccpms_pending); |
529 | &newdp->dccps_options.dccpo_pending); | ||
530 | 523 | ||
531 | /* XXX what happens with backlogs and multiple connections at | 524 | /* XXX what happens with backlogs and multiple connections at |
532 | * once... | 525 | * once... |
@@ -567,27 +560,27 @@ static int __dccp_feat_init(struct sock *sk, u8 type, u8 feat, u8 *val, u8 len) | |||
567 | 560 | ||
568 | int dccp_feat_init(struct sock *sk) | 561 | int dccp_feat_init(struct sock *sk) |
569 | { | 562 | { |
570 | struct dccp_sock *dp = dccp_sk(sk); | 563 | struct dccp_minisock *dmsk = dccp_msk(sk); |
571 | int rc; | 564 | int rc; |
572 | 565 | ||
573 | INIT_LIST_HEAD(&dp->dccps_options.dccpo_pending); | 566 | INIT_LIST_HEAD(&dmsk->dccpms_pending); |
574 | INIT_LIST_HEAD(&dp->dccps_options.dccpo_conf); | 567 | INIT_LIST_HEAD(&dmsk->dccpms_conf); |
575 | 568 | ||
576 | /* CCID L */ | 569 | /* CCID L */ |
577 | rc = __dccp_feat_init(sk, DCCPO_CHANGE_L, DCCPF_CCID, | 570 | rc = __dccp_feat_init(sk, DCCPO_CHANGE_L, DCCPF_CCID, |
578 | &dp->dccps_options.dccpo_tx_ccid, 1); | 571 | &dmsk->dccpms_tx_ccid, 1); |
579 | if (rc) | 572 | if (rc) |
580 | goto out; | 573 | goto out; |
581 | 574 | ||
582 | /* CCID R */ | 575 | /* CCID R */ |
583 | rc = __dccp_feat_init(sk, DCCPO_CHANGE_R, DCCPF_CCID, | 576 | rc = __dccp_feat_init(sk, DCCPO_CHANGE_R, DCCPF_CCID, |
584 | &dp->dccps_options.dccpo_rx_ccid, 1); | 577 | &dmsk->dccpms_rx_ccid, 1); |
585 | if (rc) | 578 | if (rc) |
586 | goto out; | 579 | goto out; |
587 | 580 | ||
588 | /* Ack ratio */ | 581 | /* Ack ratio */ |
589 | rc = __dccp_feat_init(sk, DCCPO_CHANGE_L, DCCPF_ACK_RATIO, | 582 | rc = __dccp_feat_init(sk, DCCPO_CHANGE_L, DCCPF_ACK_RATIO, |
590 | &dp->dccps_options.dccpo_ack_ratio, 1); | 583 | &dmsk->dccpms_ack_ratio, 1); |
591 | out: | 584 | out: |
592 | return rc; | 585 | return rc; |
593 | } | 586 | } |
diff --git a/net/dccp/input.c b/net/dccp/input.c index f53e3fc77262..bfc53665516b 100644 --- a/net/dccp/input.c +++ b/net/dccp/input.c | |||
@@ -60,7 +60,7 @@ static void dccp_event_ack_recv(struct sock *sk, struct sk_buff *skb) | |||
60 | { | 60 | { |
61 | struct dccp_sock *dp = dccp_sk(sk); | 61 | struct dccp_sock *dp = dccp_sk(sk); |
62 | 62 | ||
63 | if (dp->dccps_options.dccpo_send_ack_vector) | 63 | if (dccp_msk(sk)->dccpms_send_ack_vector) |
64 | dccp_ackvec_check_rcv_ackno(dp->dccps_hc_rx_ackvec, sk, | 64 | dccp_ackvec_check_rcv_ackno(dp->dccps_hc_rx_ackvec, sk, |
65 | DCCP_SKB_CB(skb)->dccpd_ack_seq); | 65 | DCCP_SKB_CB(skb)->dccpd_ack_seq); |
66 | } | 66 | } |
@@ -246,7 +246,7 @@ int dccp_rcv_established(struct sock *sk, struct sk_buff *skb, | |||
246 | if (DCCP_SKB_CB(skb)->dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ) | 246 | if (DCCP_SKB_CB(skb)->dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ) |
247 | dccp_event_ack_recv(sk, skb); | 247 | dccp_event_ack_recv(sk, skb); |
248 | 248 | ||
249 | if (dp->dccps_options.dccpo_send_ack_vector && | 249 | if (dccp_msk(sk)->dccpms_send_ack_vector && |
250 | dccp_ackvec_add(dp->dccps_hc_rx_ackvec, sk, | 250 | dccp_ackvec_add(dp->dccps_hc_rx_ackvec, sk, |
251 | DCCP_SKB_CB(skb)->dccpd_seq, | 251 | DCCP_SKB_CB(skb)->dccpd_seq, |
252 | DCCP_ACKVEC_STATE_RECEIVED)) | 252 | DCCP_ACKVEC_STATE_RECEIVED)) |
@@ -302,7 +302,7 @@ static int dccp_rcv_request_sent_state_process(struct sock *sk, | |||
302 | if (dccp_parse_options(sk, skb)) | 302 | if (dccp_parse_options(sk, skb)) |
303 | goto out_invalid_packet; | 303 | goto out_invalid_packet; |
304 | 304 | ||
305 | if (dp->dccps_options.dccpo_send_ack_vector && | 305 | if (dccp_msk(sk)->dccpms_send_ack_vector && |
306 | dccp_ackvec_add(dp->dccps_hc_rx_ackvec, sk, | 306 | dccp_ackvec_add(dp->dccps_hc_rx_ackvec, sk, |
307 | DCCP_SKB_CB(skb)->dccpd_seq, | 307 | DCCP_SKB_CB(skb)->dccpd_seq, |
308 | DCCP_ACKVEC_STATE_RECEIVED)) | 308 | DCCP_ACKVEC_STATE_RECEIVED)) |
@@ -486,7 +486,7 @@ int dccp_rcv_state_process(struct sock *sk, struct sk_buff *skb, | |||
486 | if (dcb->dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ) | 486 | if (dcb->dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ) |
487 | dccp_event_ack_recv(sk, skb); | 487 | dccp_event_ack_recv(sk, skb); |
488 | 488 | ||
489 | if (dp->dccps_options.dccpo_send_ack_vector && | 489 | if (dccp_msk(sk)->dccpms_send_ack_vector && |
490 | dccp_ackvec_add(dp->dccps_hc_rx_ackvec, sk, | 490 | dccp_ackvec_add(dp->dccps_hc_rx_ackvec, sk, |
491 | DCCP_SKB_CB(skb)->dccpd_seq, | 491 | DCCP_SKB_CB(skb)->dccpd_seq, |
492 | DCCP_ACKVEC_STATE_RECEIVED)) | 492 | DCCP_ACKVEC_STATE_RECEIVED)) |
diff --git a/net/dccp/minisocks.c b/net/dccp/minisocks.c index 5324fcacb34d..c0349e5b0551 100644 --- a/net/dccp/minisocks.c +++ b/net/dccp/minisocks.c | |||
@@ -107,6 +107,7 @@ struct sock *dccp_create_openreq_child(struct sock *sk, | |||
107 | const struct dccp_request_sock *dreq = dccp_rsk(req); | 107 | const struct dccp_request_sock *dreq = dccp_rsk(req); |
108 | struct inet_connection_sock *newicsk = inet_csk(sk); | 108 | struct inet_connection_sock *newicsk = inet_csk(sk); |
109 | struct dccp_sock *newdp = dccp_sk(newsk); | 109 | struct dccp_sock *newdp = dccp_sk(newsk); |
110 | struct dccp_minisock *newdmsk = dccp_msk(newsk); | ||
110 | 111 | ||
111 | newdp->dccps_role = DCCP_ROLE_SERVER; | 112 | newdp->dccps_role = DCCP_ROLE_SERVER; |
112 | newdp->dccps_hc_rx_ackvec = NULL; | 113 | newdp->dccps_hc_rx_ackvec = NULL; |
@@ -118,7 +119,7 @@ struct sock *dccp_create_openreq_child(struct sock *sk, | |||
118 | if (dccp_feat_clone(sk, newsk)) | 119 | if (dccp_feat_clone(sk, newsk)) |
119 | goto out_free; | 120 | goto out_free; |
120 | 121 | ||
121 | if (newdp->dccps_options.dccpo_send_ack_vector) { | 122 | if (newdmsk->dccpms_send_ack_vector) { |
122 | newdp->dccps_hc_rx_ackvec = | 123 | newdp->dccps_hc_rx_ackvec = |
123 | dccp_ackvec_alloc(GFP_ATOMIC); | 124 | dccp_ackvec_alloc(GFP_ATOMIC); |
124 | if (unlikely(newdp->dccps_hc_rx_ackvec == NULL)) | 125 | if (unlikely(newdp->dccps_hc_rx_ackvec == NULL)) |
@@ -126,10 +127,10 @@ struct sock *dccp_create_openreq_child(struct sock *sk, | |||
126 | } | 127 | } |
127 | 128 | ||
128 | newdp->dccps_hc_rx_ccid = | 129 | newdp->dccps_hc_rx_ccid = |
129 | ccid_hc_rx_new(newdp->dccps_options.dccpo_rx_ccid, | 130 | ccid_hc_rx_new(newdmsk->dccpms_rx_ccid, |
130 | newsk, GFP_ATOMIC); | 131 | newsk, GFP_ATOMIC); |
131 | newdp->dccps_hc_tx_ccid = | 132 | newdp->dccps_hc_tx_ccid = |
132 | ccid_hc_tx_new(newdp->dccps_options.dccpo_tx_ccid, | 133 | ccid_hc_tx_new(newdmsk->dccpms_tx_ccid, |
133 | newsk, GFP_ATOMIC); | 134 | newsk, GFP_ATOMIC); |
134 | if (unlikely(newdp->dccps_hc_rx_ccid == NULL || | 135 | if (unlikely(newdp->dccps_hc_rx_ccid == NULL || |
135 | newdp->dccps_hc_tx_ccid == NULL)) { | 136 | newdp->dccps_hc_tx_ccid == NULL)) { |
@@ -153,7 +154,7 @@ out_free: | |||
153 | */ | 154 | */ |
154 | 155 | ||
155 | /* See dccp_v4_conn_request */ | 156 | /* See dccp_v4_conn_request */ |
156 | newdp->dccps_options.dccpo_sequence_window = req->rcv_wnd; | 157 | newdmsk->dccpms_sequence_window = req->rcv_wnd; |
157 | 158 | ||
158 | newdp->dccps_gar = newdp->dccps_isr = dreq->dreq_isr; | 159 | newdp->dccps_gar = newdp->dccps_isr = dreq->dreq_isr; |
159 | dccp_update_gsr(newsk, dreq->dreq_isr); | 160 | dccp_update_gsr(newsk, dreq->dreq_isr); |
diff --git a/net/dccp/options.c b/net/dccp/options.c index 6e85550cc6f0..e9feb2a0c770 100644 --- a/net/dccp/options.c +++ b/net/dccp/options.c | |||
@@ -30,14 +30,14 @@ int dccp_feat_default_ack_ratio = DCCPF_INITIAL_ACK_RATIO; | |||
30 | int dccp_feat_default_send_ack_vector = DCCPF_INITIAL_SEND_ACK_VECTOR; | 30 | int dccp_feat_default_send_ack_vector = DCCPF_INITIAL_SEND_ACK_VECTOR; |
31 | int dccp_feat_default_send_ndp_count = DCCPF_INITIAL_SEND_NDP_COUNT; | 31 | int dccp_feat_default_send_ndp_count = DCCPF_INITIAL_SEND_NDP_COUNT; |
32 | 32 | ||
33 | void dccp_options_init(struct dccp_options *dccpo) | 33 | void dccp_minisock_init(struct dccp_minisock *dmsk) |
34 | { | 34 | { |
35 | dccpo->dccpo_sequence_window = dccp_feat_default_sequence_window; | 35 | dmsk->dccpms_sequence_window = dccp_feat_default_sequence_window; |
36 | dccpo->dccpo_rx_ccid = dccp_feat_default_rx_ccid; | 36 | dmsk->dccpms_rx_ccid = dccp_feat_default_rx_ccid; |
37 | dccpo->dccpo_tx_ccid = dccp_feat_default_tx_ccid; | 37 | dmsk->dccpms_tx_ccid = dccp_feat_default_tx_ccid; |
38 | dccpo->dccpo_ack_ratio = dccp_feat_default_ack_ratio; | 38 | dmsk->dccpms_ack_ratio = dccp_feat_default_ack_ratio; |
39 | dccpo->dccpo_send_ack_vector = dccp_feat_default_send_ack_vector; | 39 | dmsk->dccpms_send_ack_vector = dccp_feat_default_send_ack_vector; |
40 | dccpo->dccpo_send_ndp_count = dccp_feat_default_send_ndp_count; | 40 | dmsk->dccpms_send_ndp_count = dccp_feat_default_send_ndp_count; |
41 | } | 41 | } |
42 | 42 | ||
43 | static u32 dccp_decode_value_var(const unsigned char *bf, const u8 len) | 43 | static u32 dccp_decode_value_var(const unsigned char *bf, const u8 len) |
@@ -151,7 +151,7 @@ int dccp_parse_options(struct sock *sk, struct sk_buff *skb) | |||
151 | if (pkt_type == DCCP_PKT_DATA) | 151 | if (pkt_type == DCCP_PKT_DATA) |
152 | break; | 152 | break; |
153 | 153 | ||
154 | if (dp->dccps_options.dccpo_send_ack_vector && | 154 | if (dccp_msk(sk)->dccpms_send_ack_vector && |
155 | dccp_ackvec_parse(sk, skb, opt, value, len)) | 155 | dccp_ackvec_parse(sk, skb, opt, value, len)) |
156 | goto out_invalid_option; | 156 | goto out_invalid_option; |
157 | break; | 157 | break; |
@@ -472,12 +472,12 @@ static int dccp_insert_feat_opt(struct sk_buff *skb, u8 type, u8 feat, | |||
472 | static int dccp_insert_options_feat(struct sock *sk, struct sk_buff *skb) | 472 | static int dccp_insert_options_feat(struct sock *sk, struct sk_buff *skb) |
473 | { | 473 | { |
474 | struct dccp_sock *dp = dccp_sk(sk); | 474 | struct dccp_sock *dp = dccp_sk(sk); |
475 | struct dccp_minisock *dmsk = dccp_msk(sk); | ||
475 | struct dccp_opt_pend *opt, *next; | 476 | struct dccp_opt_pend *opt, *next; |
476 | int change = 0; | 477 | int change = 0; |
477 | 478 | ||
478 | /* confirm any options [NN opts] */ | 479 | /* confirm any options [NN opts] */ |
479 | list_for_each_entry_safe(opt, next, &dp->dccps_options.dccpo_conf, | 480 | list_for_each_entry_safe(opt, next, &dmsk->dccpms_conf, dccpop_node) { |
480 | dccpop_node) { | ||
481 | dccp_insert_feat_opt(skb, opt->dccpop_type, | 481 | dccp_insert_feat_opt(skb, opt->dccpop_type, |
482 | opt->dccpop_feat, opt->dccpop_val, | 482 | opt->dccpop_feat, opt->dccpop_val, |
483 | opt->dccpop_len); | 483 | opt->dccpop_len); |
@@ -486,11 +486,10 @@ static int dccp_insert_options_feat(struct sock *sk, struct sk_buff *skb) | |||
486 | kfree(opt->dccpop_val); | 486 | kfree(opt->dccpop_val); |
487 | kfree(opt); | 487 | kfree(opt); |
488 | } | 488 | } |
489 | INIT_LIST_HEAD(&dp->dccps_options.dccpo_conf); | 489 | INIT_LIST_HEAD(&dmsk->dccpms_conf); |
490 | 490 | ||
491 | /* see which features we need to send */ | 491 | /* see which features we need to send */ |
492 | list_for_each_entry(opt, &dp->dccps_options.dccpo_pending, | 492 | list_for_each_entry(opt, &dmsk->dccpms_pending, dccpop_node) { |
493 | dccpop_node) { | ||
494 | /* see if we need to send any confirm */ | 493 | /* see if we need to send any confirm */ |
495 | if (opt->dccpop_sc) { | 494 | if (opt->dccpop_sc) { |
496 | dccp_insert_feat_opt(skb, opt->dccpop_type + 1, | 495 | dccp_insert_feat_opt(skb, opt->dccpop_type + 1, |
@@ -536,15 +535,16 @@ static int dccp_insert_options_feat(struct sock *sk, struct sk_buff *skb) | |||
536 | int dccp_insert_options(struct sock *sk, struct sk_buff *skb) | 535 | int dccp_insert_options(struct sock *sk, struct sk_buff *skb) |
537 | { | 536 | { |
538 | struct dccp_sock *dp = dccp_sk(sk); | 537 | struct dccp_sock *dp = dccp_sk(sk); |
538 | struct dccp_minisock *dmsk = dccp_msk(sk); | ||
539 | 539 | ||
540 | DCCP_SKB_CB(skb)->dccpd_opt_len = 0; | 540 | DCCP_SKB_CB(skb)->dccpd_opt_len = 0; |
541 | 541 | ||
542 | if (dp->dccps_options.dccpo_send_ndp_count && | 542 | if (dmsk->dccpms_send_ndp_count && |
543 | dccp_insert_option_ndp(sk, skb)) | 543 | dccp_insert_option_ndp(sk, skb)) |
544 | return -1; | 544 | return -1; |
545 | 545 | ||
546 | if (!dccp_packet_without_ack(skb)) { | 546 | if (!dccp_packet_without_ack(skb)) { |
547 | if (dp->dccps_options.dccpo_send_ack_vector && | 547 | if (dmsk->dccpms_send_ack_vector && |
548 | dccp_ackvec_pending(dp->dccps_hc_rx_ackvec) && | 548 | dccp_ackvec_pending(dp->dccps_hc_rx_ackvec) && |
549 | dccp_insert_option_ackvec(sk, skb)) | 549 | dccp_insert_option_ackvec(sk, skb)) |
550 | return -1; | 550 | return -1; |
diff --git a/net/dccp/proto.c b/net/dccp/proto.c index 8a6d0a83047c..ede969074967 100644 --- a/net/dccp/proto.c +++ b/net/dccp/proto.c | |||
@@ -166,9 +166,10 @@ EXPORT_SYMBOL_GPL(dccp_unhash); | |||
166 | int dccp_init_sock(struct sock *sk, const __u8 ctl_sock_initialized) | 166 | int dccp_init_sock(struct sock *sk, const __u8 ctl_sock_initialized) |
167 | { | 167 | { |
168 | struct dccp_sock *dp = dccp_sk(sk); | 168 | struct dccp_sock *dp = dccp_sk(sk); |
169 | struct dccp_minisock *dmsk = dccp_msk(sk); | ||
169 | struct inet_connection_sock *icsk = inet_csk(sk); | 170 | struct inet_connection_sock *icsk = inet_csk(sk); |
170 | 171 | ||
171 | dccp_options_init(&dp->dccps_options); | 172 | dccp_minisock_init(&dp->dccps_minisock); |
172 | do_gettimeofday(&dp->dccps_epoch); | 173 | do_gettimeofday(&dp->dccps_epoch); |
173 | 174 | ||
174 | /* | 175 | /* |
@@ -184,22 +185,20 @@ int dccp_init_sock(struct sock *sk, const __u8 ctl_sock_initialized) | |||
184 | if (rc) | 185 | if (rc) |
185 | return rc; | 186 | return rc; |
186 | 187 | ||
187 | if (dp->dccps_options.dccpo_send_ack_vector) { | 188 | if (dmsk->dccpms_send_ack_vector) { |
188 | dp->dccps_hc_rx_ackvec = dccp_ackvec_alloc(GFP_KERNEL); | 189 | dp->dccps_hc_rx_ackvec = dccp_ackvec_alloc(GFP_KERNEL); |
189 | if (dp->dccps_hc_rx_ackvec == NULL) | 190 | if (dp->dccps_hc_rx_ackvec == NULL) |
190 | return -ENOMEM; | 191 | return -ENOMEM; |
191 | } | 192 | } |
192 | dp->dccps_hc_rx_ccid = | 193 | dp->dccps_hc_rx_ccid = ccid_hc_rx_new(dmsk->dccpms_rx_ccid, |
193 | ccid_hc_rx_new(dp->dccps_options.dccpo_rx_ccid, | 194 | sk, GFP_KERNEL); |
194 | sk, GFP_KERNEL); | 195 | dp->dccps_hc_tx_ccid = ccid_hc_tx_new(dmsk->dccpms_tx_ccid, |
195 | dp->dccps_hc_tx_ccid = | 196 | sk, GFP_KERNEL); |
196 | ccid_hc_tx_new(dp->dccps_options.dccpo_tx_ccid, | ||
197 | sk, GFP_KERNEL); | ||
198 | if (unlikely(dp->dccps_hc_rx_ccid == NULL || | 197 | if (unlikely(dp->dccps_hc_rx_ccid == NULL || |
199 | dp->dccps_hc_tx_ccid == NULL)) { | 198 | dp->dccps_hc_tx_ccid == NULL)) { |
200 | ccid_hc_rx_delete(dp->dccps_hc_rx_ccid, sk); | 199 | ccid_hc_rx_delete(dp->dccps_hc_rx_ccid, sk); |
201 | ccid_hc_tx_delete(dp->dccps_hc_tx_ccid, sk); | 200 | ccid_hc_tx_delete(dp->dccps_hc_tx_ccid, sk); |
202 | if (dp->dccps_options.dccpo_send_ack_vector) { | 201 | if (dmsk->dccpms_send_ack_vector) { |
203 | dccp_ackvec_free(dp->dccps_hc_rx_ackvec); | 202 | dccp_ackvec_free(dp->dccps_hc_rx_ackvec); |
204 | dp->dccps_hc_rx_ackvec = NULL; | 203 | dp->dccps_hc_rx_ackvec = NULL; |
205 | } | 204 | } |
@@ -208,8 +207,8 @@ int dccp_init_sock(struct sock *sk, const __u8 ctl_sock_initialized) | |||
208 | } | 207 | } |
209 | } else { | 208 | } else { |
210 | /* control socket doesn't need feat nego */ | 209 | /* control socket doesn't need feat nego */ |
211 | INIT_LIST_HEAD(&dp->dccps_options.dccpo_pending); | 210 | INIT_LIST_HEAD(&dmsk->dccpms_pending); |
212 | INIT_LIST_HEAD(&dp->dccps_options.dccpo_conf); | 211 | INIT_LIST_HEAD(&dmsk->dccpms_conf); |
213 | } | 212 | } |
214 | 213 | ||
215 | dccp_init_xmit_timers(sk); | 214 | dccp_init_xmit_timers(sk); |
@@ -247,7 +246,7 @@ int dccp_destroy_sock(struct sock *sk) | |||
247 | kfree(dp->dccps_service_list); | 246 | kfree(dp->dccps_service_list); |
248 | dp->dccps_service_list = NULL; | 247 | dp->dccps_service_list = NULL; |
249 | 248 | ||
250 | if (dp->dccps_options.dccpo_send_ack_vector) { | 249 | if (dccp_msk(sk)->dccpms_send_ack_vector) { |
251 | dccp_ackvec_free(dp->dccps_hc_rx_ackvec); | 250 | dccp_ackvec_free(dp->dccps_hc_rx_ackvec); |
252 | dp->dccps_hc_rx_ackvec = NULL; | 251 | dp->dccps_hc_rx_ackvec = NULL; |
253 | } | 252 | } |