diff options
Diffstat (limited to 'net/dccp/input.c')
-rw-r--r-- | net/dccp/input.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/net/dccp/input.c b/net/dccp/input.c index 85402532e4e9..02af05ec23a2 100644 --- a/net/dccp/input.c +++ b/net/dccp/input.c | |||
@@ -31,14 +31,9 @@ static void dccp_fin(struct sock *sk, struct sk_buff *skb) | |||
31 | 31 | ||
32 | static void dccp_rcv_close(struct sock *sk, struct sk_buff *skb) | 32 | static void dccp_rcv_close(struct sock *sk, struct sk_buff *skb) |
33 | { | 33 | { |
34 | switch (sk->sk_state) { | 34 | dccp_v4_send_reset(sk, DCCP_RESET_CODE_CLOSED); |
35 | case DCCP_PARTOPEN: | 35 | dccp_fin(sk, skb); |
36 | case DCCP_OPEN: | 36 | dccp_set_state(sk, DCCP_CLOSED); |
37 | dccp_v4_send_reset(sk, DCCP_RESET_CODE_CLOSED); | ||
38 | dccp_fin(sk, skb); | ||
39 | dccp_set_state(sk, DCCP_CLOSED); | ||
40 | break; | ||
41 | } | ||
42 | } | 37 | } |
43 | 38 | ||
44 | static void dccp_rcv_closereq(struct sock *sk, struct sk_buff *skb) | 39 | static void dccp_rcv_closereq(struct sock *sk, struct sk_buff *skb) |
@@ -54,13 +49,8 @@ static void dccp_rcv_closereq(struct sock *sk, struct sk_buff *skb) | |||
54 | return; | 49 | return; |
55 | } | 50 | } |
56 | 51 | ||
57 | switch (sk->sk_state) { | 52 | dccp_set_state(sk, DCCP_CLOSING); |
58 | case DCCP_PARTOPEN: | 53 | dccp_send_close(sk, 0); |
59 | case DCCP_OPEN: | ||
60 | dccp_set_state(sk, DCCP_CLOSING); | ||
61 | dccp_send_close(sk); | ||
62 | break; | ||
63 | } | ||
64 | } | 54 | } |
65 | 55 | ||
66 | static inline void dccp_event_ack_recv(struct sock *sk, struct sk_buff *skb) | 56 | static inline void dccp_event_ack_recv(struct sock *sk, struct sk_buff *skb) |
@@ -562,6 +552,12 @@ int dccp_rcv_state_process(struct sock *sk, struct sk_buff *skb, | |||
562 | dccp_send_sync(sk, DCCP_SKB_CB(skb)->dccpd_seq, | 552 | dccp_send_sync(sk, DCCP_SKB_CB(skb)->dccpd_seq, |
563 | DCCP_PKT_SYNC); | 553 | DCCP_PKT_SYNC); |
564 | goto discard; | 554 | goto discard; |
555 | } else if (dh->dccph_type == DCCP_PKT_CLOSEREQ) { | ||
556 | dccp_rcv_closereq(sk, skb); | ||
557 | goto discard; | ||
558 | } else if (dh->dccph_type == DCCP_PKT_CLOSE) { | ||
559 | dccp_rcv_close(sk, skb); | ||
560 | return 0; | ||
565 | } | 561 | } |
566 | 562 | ||
567 | switch (sk->sk_state) { | 563 | switch (sk->sk_state) { |