options.c (e21e696edb498c7f7eed42ba3096f6bbe13927b6) options.c (f74e91b6cca5889e667193c7e794186db73c2000)
1/*
2 * net/dccp/options.c
3 *
4 * An implementation of the DCCP protocol
5 * Copyright (c) 2005 Aristeu Sergio Rozanski Filho <aris@cathedrallabs.org>
6 * Copyright (c) 2005 Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
7 * Copyright (c) 2005 Ian McDonald <ian.mcdonald@jandi.co.nz>
8 *

--- 475 unchanged lines hidden (view full) ---

484 dccp_pr_debug("%s(%s (%d), ...), length %d\n",
485 dccp_feat_typename(type),
486 dccp_feat_name(feat), feat, len);
487 return 0;
488}
489
490static int dccp_insert_options_feat(struct sock *sk, struct sk_buff *skb)
491{
1/*
2 * net/dccp/options.c
3 *
4 * An implementation of the DCCP protocol
5 * Copyright (c) 2005 Aristeu Sergio Rozanski Filho <aris@cathedrallabs.org>
6 * Copyright (c) 2005 Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
7 * Copyright (c) 2005 Ian McDonald <ian.mcdonald@jandi.co.nz>
8 *

--- 475 unchanged lines hidden (view full) ---

484 dccp_pr_debug("%s(%s (%d), ...), length %d\n",
485 dccp_feat_typename(type),
486 dccp_feat_name(feat), feat, len);
487 return 0;
488}
489
490static int dccp_insert_options_feat(struct sock *sk, struct sk_buff *skb)
491{
492 struct dccp_sock *dp = dccp_sk(sk);
493 struct dccp_minisock *dmsk = dccp_msk(sk);
494 struct dccp_opt_pend *opt, *next;
495 int change = 0;
496
497 /* confirm any options [NN opts] */
498 list_for_each_entry_safe(opt, next, &dmsk->dccpms_conf, dccpop_node) {
499 dccp_insert_feat_opt(skb, opt->dccpop_type,
500 opt->dccpop_feat, opt->dccpop_val,

--- 24 unchanged lines hidden (view full) ---

525 if (!opt->dccpop_conf) {
526 dccp_insert_feat_opt(skb, opt->dccpop_type,
527 opt->dccpop_feat, opt->dccpop_val,
528 opt->dccpop_len);
529 change++;
530 }
531 }
532
492 struct dccp_minisock *dmsk = dccp_msk(sk);
493 struct dccp_opt_pend *opt, *next;
494 int change = 0;
495
496 /* confirm any options [NN opts] */
497 list_for_each_entry_safe(opt, next, &dmsk->dccpms_conf, dccpop_node) {
498 dccp_insert_feat_opt(skb, opt->dccpop_type,
499 opt->dccpop_feat, opt->dccpop_val,

--- 24 unchanged lines hidden (view full) ---

524 if (!opt->dccpop_conf) {
525 dccp_insert_feat_opt(skb, opt->dccpop_type,
526 opt->dccpop_feat, opt->dccpop_val,
527 opt->dccpop_len);
528 change++;
529 }
530 }
531
533 /* Retransmit timer.
534 * If this is the master listening sock, we don't set a timer on it. It
535 * should be fine because if the dude doesn't receive our RESPONSE
536 * [which will contain the CHANGE] he will send another REQUEST which
537 * will "retrnasmit" the change.
538 */
539 if (change && dp->dccps_role != DCCP_ROLE_LISTEN) {
540 dccp_pr_debug("reset feat negotiation timer %p\n", sk);
541
542 /* XXX don't reset the timer on re-transmissions. I.e. reset it
543 * only when sending new stuff i guess. Currently the timer
544 * never backs off because on re-transmission it just resets it!
545 */
546 inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS,
547 inet_csk(sk)->icsk_rto, DCCP_RTO_MAX);
548 }
549
550 return 0;
551}
552
553/* The length of all options needs to be a multiple of 4 (5.8) */
554static void dccp_insert_option_padding(struct sk_buff *skb)
555{
556 int padding = DCCP_SKB_CB(skb)->dccpd_opt_len % 4;
557

--- 65 unchanged lines hidden ---
532 return 0;
533}
534
535/* The length of all options needs to be a multiple of 4 (5.8) */
536static void dccp_insert_option_padding(struct sk_buff *skb)
537{
538 int padding = DCCP_SKB_CB(skb)->dccpd_opt_len % 4;
539

--- 65 unchanged lines hidden ---