diff options
author | Gerrit Renker <gerrit@erg.abdn.ac.uk> | 2010-10-11 14:36:33 -0400 |
---|---|---|
committer | Gerrit Renker <gerrit@erg.abdn.ac.uk> | 2010-10-12 00:57:40 -0400 |
commit | 93344af44c0f649582bf1e3b5ecc45b3d19e98c2 (patch) | |
tree | 582193ad30a6b0f2523b667bd0a39ca70d9dcba0 /net/dccp/output.c | |
parent | 0b53d4604ac2b4f2faa9a62a04ea9b383ad2efe0 (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/output.c')
-rw-r--r-- | net/dccp/output.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/net/dccp/output.c b/net/dccp/output.c index aadbdb58758b..6993a9338cf7 100644 --- a/net/dccp/output.c +++ b/net/dccp/output.c | |||
@@ -474,8 +474,9 @@ int dccp_send_reset(struct sock *sk, enum dccp_reset_codes code) | |||
474 | /* | 474 | /* |
475 | * Do all connect socket setups that can be done AF independent. | 475 | * Do all connect socket setups that can be done AF independent. |
476 | */ | 476 | */ |
477 | static inline void dccp_connect_init(struct sock *sk) | 477 | int dccp_connect(struct sock *sk) |
478 | { | 478 | { |
479 | struct sk_buff *skb; | ||
479 | struct dccp_sock *dp = dccp_sk(sk); | 480 | struct dccp_sock *dp = dccp_sk(sk); |
480 | struct dst_entry *dst = __sk_dst_get(sk); | 481 | struct dst_entry *dst = __sk_dst_get(sk); |
481 | struct inet_connection_sock *icsk = inet_csk(sk); | 482 | struct inet_connection_sock *icsk = inet_csk(sk); |
@@ -485,22 +486,12 @@ static inline void dccp_connect_init(struct sock *sk) | |||
485 | 486 | ||
486 | dccp_sync_mss(sk, dst_mtu(dst)); | 487 | dccp_sync_mss(sk, dst_mtu(dst)); |
487 | 488 | ||
488 | /* Initialise GAR as per 8.5; AWL/AWH are set in dccp_transmit_skb() */ | ||
489 | dp->dccps_gar = dp->dccps_iss; | ||
490 | |||
491 | icsk->icsk_retransmits = 0; | ||
492 | } | ||
493 | |||
494 | int dccp_connect(struct sock *sk) | ||
495 | { | ||
496 | struct sk_buff *skb; | ||
497 | struct inet_connection_sock *icsk = inet_csk(sk); | ||
498 | |||
499 | /* do not connect if feature negotiation setup fails */ | 489 | /* do not connect if feature negotiation setup fails */ |
500 | if (dccp_feat_finalise_settings(dccp_sk(sk))) | 490 | if (dccp_feat_finalise_settings(dccp_sk(sk))) |
501 | return -EPROTO; | 491 | return -EPROTO; |
502 | 492 | ||
503 | dccp_connect_init(sk); | 493 | /* Initialise GAR as per 8.5; AWL/AWH are set in dccp_transmit_skb() */ |
494 | dp->dccps_gar = dp->dccps_iss; | ||
504 | 495 | ||
505 | skb = alloc_skb(sk->sk_prot->max_header, sk->sk_allocation); | 496 | skb = alloc_skb(sk->sk_prot->max_header, sk->sk_allocation); |
506 | if (unlikely(skb == NULL)) | 497 | if (unlikely(skb == NULL)) |
@@ -516,6 +507,7 @@ int dccp_connect(struct sock *sk) | |||
516 | DCCP_INC_STATS(DCCP_MIB_ACTIVEOPENS); | 507 | DCCP_INC_STATS(DCCP_MIB_ACTIVEOPENS); |
517 | 508 | ||
518 | /* Timer for repeating the REQUEST until an answer. */ | 509 | /* Timer for repeating the REQUEST until an answer. */ |
510 | icsk->icsk_retransmits = 0; | ||
519 | inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS, | 511 | inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS, |
520 | icsk->icsk_rto, DCCP_RTO_MAX); | 512 | icsk->icsk_rto, DCCP_RTO_MAX); |
521 | return 0; | 513 | return 0; |