From b96154dafe2400e0e6074f059bc7c4bd16b5d147 Mon Sep 17 00:00:00 2001
From: Charlie Root <root@freebsd11.testbed>
Date: Wed, 16 Sep 2015 18:25:38 +0200
Subject: [PATCH] Simplify condition.

No functional change.
---
 gtests/net/packetdrill/run_packet.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/gtests/net/packetdrill/run_packet.c b/gtests/net/packetdrill/run_packet.c
index 1767528d..2aa404f1 100644
--- a/gtests/net/packetdrill/run_packet.c
+++ b/gtests/net/packetdrill/run_packet.c
@@ -2409,14 +2409,8 @@ static int do_inbound_script_packet(
 				}
 				break;
 			case SCTP_COOKIE_ECHO_CHUNK_TYPE:
-				if (!(item->flags & FLAG_CHUNK_VALUE_NOCHECK)) break;	// if the cookie was explicitly 
-											// added to the test script, we dont
-											// need to copy the saved cookie
-											// from the init_ack chunk ...
-											// TODO: can this be done in a more readable way?
-											
-				
-				if (socket->state == SOCKET_PASSIVE_INIT_ACK_SENT) {
+				if ((socket->state == SOCKET_PASSIVE_INIT_ACK_SENT) &&
+				    (item->flags & FLAG_CHUNK_VALUE_NOCHECK)) {
 					temp_offset = socket->prepared_cookie_echo_length - item->length;
 					assert(packet->ip_bytes + temp_offset <= packet->buffer_bytes);
 					memmove((u8 *)item->chunk + item->length + temp_offset,
-- 
GitLab