Ver código fonte

[DCCP]: Check if already in the CLOSING state in dccp_rcv_closereq

It is possible to receive more than one CLOSEREQ packet if the
CLOSE packet sent in response is somehow lost, change the state
to DCCP_CLOSING only on the first CLOSEREQ packet received.

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Arnaldo Carvalho de Melo 19 anos atrás
pai
commit
811265b8e8
1 arquivos alterados com 2 adições e 1 exclusões
  1. 2 1
      net/dccp/input.c

+ 2 - 1
net/dccp/input.c

@@ -50,7 +50,8 @@ static void dccp_rcv_closereq(struct sock *sk, struct sk_buff *skb)
 		return;
 	}
 
-	dccp_set_state(sk, DCCP_CLOSING);
+	if (sk->sk_state != DCCP_CLOSING)
+		dccp_set_state(sk, DCCP_CLOSING);
 	dccp_send_close(sk, 0);
 }