From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B9A0045CD8; Mon, 18 Nov 2024 19:23:03 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8A78742DD0; Mon, 18 Nov 2024 19:22:17 +0100 (CET) Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) by mails.dpdk.org (Postfix) with ESMTP id 99A74427C9 for ; Mon, 18 Nov 2024 19:22:10 +0100 (CET) Received: by mail-pj1-f54.google.com with SMTP id 98e67ed59e1d1-2ea1e605193so1891891a91.0 for ; Mon, 18 Nov 2024 10:22:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1731954130; x=1732558930; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=F8L0Sbp7CmbMo7pZMh5Sb9k5o2mNt+kbwIL7cwBlPOc=; b=Sp+NtPpcrSqK2/lkT7fTO4DeKwtO8x44brv0mwCoOp28Fc2M6OdEfbvumMMKG4yiOy gQV3tXxEfV4FcwGBNFcMRInBu7qZoDGayvYvWly3M+AYbgJ/CmdXL/8D7y+K7xmZb5wa LKNfXDkerQxwhg2v1gksd4E2QrkGq+vjGKRz5hT5STcEnZ1JtBCWU4TmMLF9ng4lX+Tb xerDP9rqdFLH5ZLr3dkSK5hp6mDSfgHiHhFzHfYbeSuc0eFJ8lM/R3dxoZfLwpfjWr0Q /OMc88mpOlUOoPs1YA7b0CsyJHwD3cUMMkvKiADhfTKOdTa3PBuHltm/HN8CiYZwYA6z sY+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731954130; x=1732558930; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=F8L0Sbp7CmbMo7pZMh5Sb9k5o2mNt+kbwIL7cwBlPOc=; b=mmgyBcHw3g7wMef0K6VP6zWEGMvBsSVmq3u9RGQo4pROHweQWLXRxs+JQYYxgm2fwH 8A2SNlZapG5sp2iy5cBbNF2E6rkyE9p2ZEZF6wuoqlYNDYHMwDsn0MudjJuFaMnBr3J2 R3Jvqa9721YL+ffPoQtaR+JyQnn0QuhZzLgn99j3/0zIfsxRghoDbqiXuz95Y5oaIgAC 5A3Le/OMEJs5ql1soM7oXlVNBAw9RkWzlOK57A8twgd9tVmnBxclc6h1W1wbGXd/zogC LW8m/qJWp6DJmeJGQ0IP2uGwkVJRZD5U/DiuXTOUw4KGknMqSYNLFYZg11FV8bhIfnCe V2Ig== X-Gm-Message-State: AOJu0YxUNJh5V/Fe9GcSProxCnHB/1ZEUA9dEzBW61iIbzpOrmW/IlXh Kf+bCYW5sW1r1wjOhSsrbB5qPpiU7eQb1O4SM6bpatoluZZe52Hbp7JMvFhsWLWA2PPyfz0DvRt G X-Google-Smtp-Source: AGHT+IFWK+w2y3N51TPAvl/Gdtzkc3/46vDQt2rLBLVpKJrBPHnW1xef2G6atK+SkSMnL+o+Z9WOGw== X-Received: by 2002:a17:90b:3510:b0:2ea:a9ac:eef5 with SMTP id 98e67ed59e1d1-2eaa9acf092mr891495a91.1.1731954129772; Mon, 18 Nov 2024 10:22:09 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ea61869bb2sm2916724a91.12.2024.11.18.10.22.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Nov 2024 10:22:09 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , danielx.t.mrzyglod@intel.com, stable@dpdk.org Subject: [PATCH v2 09/19] examples/ptpclient: fix self memcmp Date: Mon, 18 Nov 2024 10:20:50 -0800 Message-ID: <20241118182153.87042-10-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241118182153.87042-1-stephen@networkplumber.org> References: <20241115060738.313190-1-stephen@networkplumber.org> <20241118182153.87042-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Calling memcmp on same structure will always be true. Replace with same conditional used elsewhere. Link: https://pvs-studio.com/en/blog/posts/cpp/1183/ Fixes: ab129e9065a5 ("examples/ptpclient: add minimal PTP client") Cc: danielx.t.mrzyglod@intel.com Cc: stable@dpdk.org Signed-off-by: Stephen Hemminger --- examples/ptpclient/ptpclient.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c index 2ec532d058..d6dff2eb7e 100644 --- a/examples/ptpclient/ptpclient.c +++ b/examples/ptpclient/ptpclient.c @@ -419,7 +419,7 @@ parse_sync(struct ptpv2_time_receiver_ordinary *ptp_data, uint16_t rx_tstamp_idx ptp_data->ptpset = 1; } - if (memcmp(&ptp_hdr->source_port_id.clock_id, + if (memcmp(&ptp_data->transmitter_clock_id, &ptp_hdr->source_port_id.clock_id, sizeof(struct clock_id)) == 0) { -- 2.45.2