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 EFD1E45CD8 for ; Mon, 18 Nov 2024 19:22:21 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AABB7427DA; Mon, 18 Nov 2024 19:22:18 +0100 (CET) Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) by mails.dpdk.org (Postfix) with ESMTP id 9B9FF427CA for ; Mon, 18 Nov 2024 19:22:10 +0100 (CET) Received: by mail-pj1-f52.google.com with SMTP id 98e67ed59e1d1-2ea45dac86eso1614403a91.3 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=X1Y/jrvwRt9Or07wwHdLxqzZ3JBT+4jBpsEveo9/o+M+X3UP7kmFqgXigp/FTEkoU3 7UIsjomOLmVLvswxYXqWCPM9GNRfy6AjdkEVGFg9vzUgM99pGfWtohsQwIJ9YMC6mFh8 z3ch+UdlyBommg/gs1x1nhw7ilaTuRWDmuCCgKsnn2QBWUS+06qhb5cyGxIcAzc3reH9 fNkMvpKBWbISqqQegtso5OSeuW5DLFEPYHwe+yEVynIqIM8vy3WvtQ89hq1q+Y3V4iNx pxhs2GEPZzgJG22LzNnHWCeQXkcm3dn7fEk0gsHYyC3BPt4W3kOuOrkN9VLZTUWU9LEs YjjA== X-Forwarded-Encrypted: i=1; AJvYcCW8ckNJnWdTs14a2DRZM8Lc9iEkhUl8S72moENMHWQ5p5Xjles5iQFVXdSjTy7A2YmsbLLHWnc=@dpdk.org X-Gm-Message-State: AOJu0YwrETx+41b9Su5CNGCIsZjS1wwFtuyAg3yDL0ZQTU1S0YniIBMe 6elHyFEZkZg8Dk4BePNG3YOwN7Spxd20k0g70Er1in5GuFgFDcVPSKsZ3RwXThKZO7YUJfYt/rt X 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: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-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