Skip to contentSkip to conversation

: Remove duplicate test for CloseReq

PATCH Applied Gerrit Renker 2 participants 2 messages Nov 28, 2007 Networking

lore
Share & tools
lore
#0 lore raw

PATCH 4/4 : Remove duplicate test for CloseReq

[DCCP]: Remove duplicate test for CloseReq

This removes a redundant test for unexpected packet types. In dccp_rcv_state_process it is tested twice whether a DCCP-server has received a CloseReq (Step 7):

* first in the combined if-statement,
* then in the call to dccp_rcv_closereq().

The latter is necesssary since dccp_rcv_closereq() is also called from __dccp_rcv_established().

This patch removes the duplicate test.

---
 net/dccp/input.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
net/dccp/input.c +2 -4
@@ -616,16 +616,14 @@ int dccp_rcv_state_process(struct sock *
 		return 0;
 		/*
 		 *   Step 7: Check for unexpected packet types
-		 *      If (S.is_server and P.type = CloseReq)
-		 *	    or (S.is_server and P.type = Response)
+		 *      If (S.is_server and P.type = Response)
 		 *	    or (S.is_client and P.type = Request)
 		 *	    or (S.state = RESPOND and P.type = Data),
 		 *	  Send Sync packet acknowledging P.seqno
 		 *	  Drop packet and return
 		 */
 	} else if ((dp->dccps_role != DCCP_ROLE_CLIENT &&
-		    (dh->dccph_type = DCCP_PKT_RESPONSE ||
-		     dh->dccph_type = DCCP_PKT_CLOSEREQ)) ||
+		    dh->dccph_type = DCCP_PKT_RESPONSE) ||
 		    (dp->dccps_role = DCCP_ROLE_CLIENT &&
 		     dh->dccph_type = DCCP_PKT_REQUEST) ||
 		    (sk->sk_state = DCCP_RESPOND &&
#1 lore raw

Em Wed, Nov 28, 2007 at 08:35:11AM +0000, Gerrit Renker escreveu:

Quoted 8 lines

[DCCP]: Remove duplicate test for CloseReq

This removes a redundant test for unexpected packet types. In dccp_rcv_state_process it is tested twice whether a DCCP-server has received a CloseReq (Step 7):

* first in the combined if-statement,
* then in the call to dccp_rcv_closereq().

Quoted 6 lines

The latter is necesssary since dccp_rcv_closereq() is also called from __dccp_rcv_established().

This patch removes the duplicate test.

Thanks, applied.

- Arnaldo