diff options
Diffstat (limited to 'net/dccp/output.c')
-rw-r--r-- | net/dccp/output.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/net/dccp/output.c b/net/dccp/output.c index fe20068c5d8e..d19d48195013 100644 --- a/net/dccp/output.c +++ b/net/dccp/output.c | |||
@@ -284,14 +284,26 @@ void dccp_write_xmit(struct sock *sk, int block) | |||
284 | } | 284 | } |
285 | } | 285 | } |
286 | 286 | ||
287 | int dccp_retransmit_skb(struct sock *sk, struct sk_buff *skb) | 287 | /** |
288 | * dccp_retransmit_skb - Retransmit Request, Close, or CloseReq packets | ||
289 | * There are only four retransmittable packet types in DCCP: | ||
290 | * - Request in client-REQUEST state (sec. 8.1.1), | ||
291 | * - CloseReq in server-CLOSEREQ state (sec. 8.3), | ||
292 | * - Close in node-CLOSING state (sec. 8.3), | ||
293 | * - Acks in client-PARTOPEN state (sec. 8.1.5, handled by dccp_delack_timer()). | ||
294 | * This function expects sk->sk_send_head to contain the original skb. | ||
295 | */ | ||
296 | int dccp_retransmit_skb(struct sock *sk) | ||
288 | { | 297 | { |
298 | WARN_ON(sk->sk_send_head == NULL); | ||
299 | |||
289 | if (inet_csk(sk)->icsk_af_ops->rebuild_header(sk) != 0) | 300 | if (inet_csk(sk)->icsk_af_ops->rebuild_header(sk) != 0) |
290 | return -EHOSTUNREACH; /* Routing failure or similar. */ | 301 | return -EHOSTUNREACH; /* Routing failure or similar. */ |
291 | 302 | ||
292 | return dccp_transmit_skb(sk, (skb_cloned(skb) ? | 303 | /* this count is used to distinguish original and retransmitted skb */ |
293 | pskb_copy(skb, GFP_ATOMIC): | 304 | inet_csk(sk)->icsk_retransmits++; |
294 | skb_clone(skb, GFP_ATOMIC))); | 305 | |
306 | return dccp_transmit_skb(sk, skb_clone(sk->sk_send_head, GFP_ATOMIC)); | ||
295 | } | 307 | } |
296 | 308 | ||
297 | struct sk_buff *dccp_make_response(struct sock *sk, struct dst_entry *dst, | 309 | struct sk_buff *dccp_make_response(struct sock *sk, struct dst_entry *dst, |