aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp
diff options
context:
space:
mode:
authorGerrit Renker <gerrit@erg.abdn.ac.uk>2008-09-04 01:30:19 -0400
committerGerrit Renker <gerrit@erg.abdn.ac.uk>2008-09-04 01:45:35 -0400
commita9c1656ab10480cc6f6d34f193bcde2729fe8037 (patch)
treeec5f69d1d95fa718d6f930b4d42060918ab64e5c /net/dccp
parentbfbddd085a5bced6efb9e1bc4d029438f9639784 (diff)
dccp: Merge now-reduced connect_init() function
After moving the assignment of GAR/ISS from dccp_connect_init() to dccp_transmit_skb(), the former function becomes very small, so that a merger with dccp_connect() suggests itself. Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Diffstat (limited to 'net/dccp')
-rw-r--r--net/dccp/output.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/net/dccp/output.c b/net/dccp/output.c
index be65bc30e201..1b3168307586 100644
--- a/net/dccp/output.c
+++ b/net/dccp/output.c
@@ -471,8 +471,9 @@ int dccp_send_reset(struct sock *sk, enum dccp_reset_codes code)
471/* 471/*
472 * Do all connect socket setups that can be done AF independent. 472 * Do all connect socket setups that can be done AF independent.
473 */ 473 */
474static inline void dccp_connect_init(struct sock *sk) 474int dccp_connect(struct sock *sk)
475{ 475{
476 struct sk_buff *skb;
476 struct dccp_sock *dp = dccp_sk(sk); 477 struct dccp_sock *dp = dccp_sk(sk);
477 struct dst_entry *dst = __sk_dst_get(sk); 478 struct dst_entry *dst = __sk_dst_get(sk);
478 struct inet_connection_sock *icsk = inet_csk(sk); 479 struct inet_connection_sock *icsk = inet_csk(sk);
@@ -482,22 +483,12 @@ static inline void dccp_connect_init(struct sock *sk)
482 483
483 dccp_sync_mss(sk, dst_mtu(dst)); 484 dccp_sync_mss(sk, dst_mtu(dst));
484 485
485 /* Initialise GAR as per 8.5; AWL/AWH are set in dccp_transmit_skb() */
486 dp->dccps_gar = dp->dccps_iss;
487
488 icsk->icsk_retransmits = 0;
489}
490
491int dccp_connect(struct sock *sk)
492{
493 struct sk_buff *skb;
494 struct inet_connection_sock *icsk = inet_csk(sk);
495
496 /* do not connect if feature negotiation setup fails */ 486 /* do not connect if feature negotiation setup fails */
497 if (dccp_feat_finalise_settings(dccp_sk(sk))) 487 if (dccp_feat_finalise_settings(dccp_sk(sk)))
498 return -EPROTO; 488 return -EPROTO;
499 489
500 dccp_connect_init(sk); 490 /* Initialise GAR as per 8.5; AWL/AWH are set in dccp_transmit_skb() */
491 dp->dccps_gar = dp->dccps_iss;
501 492
502 skb = alloc_skb(sk->sk_prot->max_header, sk->sk_allocation); 493 skb = alloc_skb(sk->sk_prot->max_header, sk->sk_allocation);
503 if (unlikely(skb == NULL)) 494 if (unlikely(skb == NULL))
@@ -513,6 +504,7 @@ int dccp_connect(struct sock *sk)
513 DCCP_INC_STATS(DCCP_MIB_ACTIVEOPENS); 504 DCCP_INC_STATS(DCCP_MIB_ACTIVEOPENS);
514 505
515 /* Timer for repeating the REQUEST until an answer. */ 506 /* Timer for repeating the REQUEST until an answer. */
507 icsk->icsk_retransmits = 0;
516 inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS, 508 inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS,
517 icsk->icsk_rto, DCCP_RTO_MAX); 509 icsk->icsk_rto, DCCP_RTO_MAX);
518 return 0; 510 return 0;