From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=fail (p=quarantine dis=none) header.from=redhat.com Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTPS id 65E955A026E for ; Thu, 15 Oct 2026 12:07:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1792058867; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UmpvE4p8+BWTfhwppuetKEevCn59+PQQwC10gg9b1xU=; b=Ghesx0reT/hyAhfGWO3MK14mPYLYYAzpA2+YY93rr+mPM6sI10soov6T81mNj26YSlP9Zp I/GZm7wXhVDNq4ARwVLw4EUkCS+iUQQ5sId01JF+bog+uz0xIKtu4kuRM+2+wt6GDJpNnm O1myqPQE7wh0AMs1MKQaeooXEVPtQUo= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-558-QKAk7rTdNQ6s411eS4ZdVg-1; Thu, 15 Oct 2026 10:07:45 +0000 X-MC-Unique: QKAk7rTdNQ6s411eS4ZdVg-1 X-Mimecast-MFC-AGG-ID: QKAk7rTdNQ6s411eS4ZdVg_1792058864 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id CF75418000A3 for ; Thu, 15 Oct 2026 10:07:44 +0000 (UTC) Received: from lenovo-t14s.redhat.corp (headnet05.pony-001.prod.iad2.dc.redhat.com [10.2.32.117]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 039C7195608A; Thu, 15 Oct 2026 10:07:43 +0000 (UTC) From: Laurent Vivier To: passt-dev@passt.top Subject: [PATCH 1/2] tcp: Drop always-true !partial_send condition in tcp_data_from_tap() Date: Thu, 15 Oct 2026 12:07:40 +0200 Message-ID: <20261015100741.1583455-2-lvivier@redhat.com> In-Reply-To: <20261015100741.1583455-1-lvivier@redhat.com> References: <20261015100741.1583455-1-lvivier@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: kVJuuFJPU4R2CA2qASwJHTCE2Si46u-lC-lIV-MrldY_1792058864 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true Message-ID-Hash: T6WAVEHA2ZE7VQTRCVR7YOFKP7IO7KY4 X-Message-ID-Hash: T6WAVEHA2ZE7VQTRCVR7YOFKP7IO7KY4 X-MailFrom: lvivier@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Laurent Vivier X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: When partial_send is true, the code returns early at the "keep != -1 || partial_send" check before reaching the fin handling block. Therefore the !partial_send guard on the fin handling is always true when reached and can be removed. Detected with cppcheck 2.22.0 Signed-off-by: Laurent Vivier --- tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcp.c b/tcp.c index e279f8a121a5..95f4f3e12cf0 100644 --- a/tcp.c +++ b/tcp.c @@ -2160,7 +2160,7 @@ out: conn->seq_ack_from_tap == conn->seq_to_tap) conn_event(c, conn, TAP_FIN_ACKED, now); - if (fin && !partial_send) { + if (fin) { conn->seq_from_tap++; conn_event(c, conn, TAP_FIN_RCVD, now); -- 2.56.0