From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=PV6wN6Gn; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTPS id 6F28F5A061A for ; Fri, 20 Mar 2026 14:51:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1774014684; 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=ZoZAIrMqQwTVEiNGS6uCK6rzf+ip1uHtmfkcyNqysfY=; b=PV6wN6GnAbOjStd0iU4WLsfojQHszHwLWEfEYHRbcJvHDCM1TYl+eCAYEL4uLWxZYmYSev b/nABk5LTISsRh1B5iLNM9ncC4ZR1MlKGE+H7B5NrYjZxPHrsRYGVOCmzbNkVPo42FhhSZ R+/Le3YbIeHFzwHT/Fw5WW/vQl34ODA= Received: from mx-prod-mc-06.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-341-zWYQfr35NCuocGiH0eWk4A-1; Fri, 20 Mar 2026 09:51:21 -0400 X-MC-Unique: zWYQfr35NCuocGiH0eWk4A-1 X-Mimecast-MFC-AGG-ID: zWYQfr35NCuocGiH0eWk4A_1774014681 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D7EC61800622 for ; Fri, 20 Mar 2026 13:51:20 +0000 (UTC) Received: from lenovo-t14s.redhat.com (unknown [10.45.224.233]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E5A591800769; Fri, 20 Mar 2026 13:51:19 +0000 (UTC) From: Laurent Vivier To: passt-dev@passt.top Subject: [PATCH trivial 1/3] tcp_vu: Remove redundant eh->h_proto assignments Date: Fri, 20 Mar 2026 14:51:14 +0100 Message-ID: <20260320135116.575416-2-lvivier@redhat.com> In-Reply-To: <20260320135116.575416-1-lvivier@redhat.com> References: <20260320135116.575416-1-lvivier@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: mVv8RbVpTjhRSlHVG8h5s8vyqINP9RvnC1j59zKoBhM_1774014681 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true Message-ID-Hash: IMOYPBDIDCI67O6PIX7QTYERQ5L4B6YQ X-Message-ID-Hash: IMOYPBDIDCI67O6PIX7QTYERQ5L4B6YQ 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: tcp_fill_headers() unconditionally sets eh->h_proto based on whether ip4h or ip6h is non-NULL. The assignments in tcp_vu_send_flag() and tcp_vu_prepare() are therefore redundant and can be removed. Signed-off-by: Laurent Vivier --- tcp_vu.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/tcp_vu.c b/tcp_vu.c index fd734e857b3b..c616b1fec2bf 100644 --- a/tcp_vu.c +++ b/tcp_vu.c @@ -105,15 +105,11 @@ int tcp_vu_send_flag(const struct ctx *c, struct tcp_tap_conn *conn, int flags) memcpy(eh->h_source, c->our_tap_mac, sizeof(eh->h_source)); if (CONN_V4(conn)) { - eh->h_proto = htons(ETH_P_IP); - ip4h = vu_ip(flags_elem[0].in_sg[0].iov_base); *ip4h = (struct iphdr)L2_BUF_IP4_INIT(IPPROTO_TCP); th = vu_payloadv4(flags_elem[0].in_sg[0].iov_base); } else { - eh->h_proto = htons(ETH_P_IPV6); - ip6h = vu_ip(flags_elem[0].in_sg[0].iov_base); *ip6h = (struct ipv6hdr)L2_BUF_IP6_INIT(IPPROTO_TCP); th = vu_payloadv6(flags_elem[0].in_sg[0].iov_base); @@ -307,14 +303,10 @@ static void tcp_vu_prepare(const struct ctx *c, struct tcp_tap_conn *conn, /* initialize header */ if (!v6) { - eh->h_proto = htons(ETH_P_IP); - ip4h = vu_ip(base); *ip4h = (struct iphdr)L2_BUF_IP4_INIT(IPPROTO_TCP); th = vu_payloadv4(base); } else { - eh->h_proto = htons(ETH_P_IPV6); - ip6h = vu_ip(base); *ip6h = (struct ipv6hdr)L2_BUF_IP6_INIT(IPPROTO_TCP); -- 2.53.0