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 149264626B for ; Wed, 19 Feb 2025 18:16:26 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0E6834028B; Wed, 19 Feb 2025 18:16:26 +0100 (CET) Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by mails.dpdk.org (Postfix) with ESMTP id EF8AB4028B for ; Wed, 19 Feb 2025 18:16:23 +0100 (CET) Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-220dc3831e3so18573055ad.0 for ; Wed, 19 Feb 2025 09:16:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1739985383; x=1740590183; darn=dpdk.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=NaUw72S4WMmtq5zD/WZQADUIUMBtzYw8TfJ+FZLzA/g=; b=HsmzxTzcBOh9NAMwVOJmmMwbCDNa5vrjnQmak7iQFTHq6etA4XyooKAgZoAphp/dpz 2J0AjGGpoznZAMr8GHdUgdVEGTH6mHfML+kZWk5vdoF3agvbNczLDOTOl4LYZaj7RpC/ cTnZJ+u6EjGl+HjFdVdPeTb9GR3NIWHLG++Bxln2pvTYW9MH6Z7A+VShz9i1PGRdM9fM brvd8NVSI+DF7/3gr2ANKmdE8ay89QEM4cWqKpqoHa3ZrjxVnS7qEY3A8IQ3Jh5pBOV3 HO3bwEMxx4gpuMKumT2OvTW/TfK3c4fUaFfq8s33SBrljp0JZTv9VR3CUwIoBouxzpUo lC8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739985383; x=1740590183; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=NaUw72S4WMmtq5zD/WZQADUIUMBtzYw8TfJ+FZLzA/g=; b=RsSDOHjROAPcrMHwrXU/oO582KrdK4O9TerLvGc8GBXiJCHtnQy1fTy4TSGXIuRytn C1895Pm0Kh6ek6Mmem0/s/tdag/3qgHsc3yQ9L+meoQGyefnwl2Ncfy/nZoxUz2ehjTH Cl7scCaxhclXTmc3MmZKLjlbBZJ+z3VwpNr2y6d6m1N27Gkd5hk2F/nJtu8zrG9hDs9/ xcXweQyTtit1zZmXV35oSqcFnmLblyggM7U6C2O3jr34PU/carZUHjHmudekFlU9lrF2 jQ0kqzmtn1NK7XAGQPkxOmDa0ww3BC4RI5ip3PI3BjLGf2wlbGWoa8zZWoSPsPQY+375 ZfbA== X-Gm-Message-State: AOJu0YxNDLD4y+YmvnZeBYjhUv4bf80otj9saUv83HXZqB3S6w+qRyRx 7utxnd+SzxLY2h+OujrreDnQD2kRAM0F7V4d3Wm2EnDtUKNHSanNP8l/B0FvFI8dWnf/UcIeX4V uuxQ= X-Gm-Gg: ASbGncsLRoNBYcFAmCjWd9IWDpDpfICaIePTHRk3HzQZXfcsp1LggUfuuReEjZo2fhe 5jqbU5UbH8ocEVCZKv/DPZFc/nU8F0tF5sl6pznHMsOKCkICTLA3HmZioBf6MV/CbRSl5CCX3Kt kElAR+isOD1GFPki6Bu44i98cGEMcBkxd7lIaEJZ3exOJSC9DhMKzPzC6MfCqVXWdcVzGLDx6r2 J0S1/s5jrW1d1yh2ua1iMZFpxyHw5vHmAPxQiC2GtPtGpEriKOi6KaOuYm4NWCyK11uVHkKn67s ad5rpOkhuUNUIZn9piih4j7cV1of/MLQ5cJn2HWEHMIdlnwFDOfbVLEiLkdfnK9EGk0l X-Google-Smtp-Source: AGHT+IE9f/5q7xyLBWCZXMZHrR/+0PNyqUhV0KzAv7xuJtHmC1PIqXyjKLsfDUx3vHa9Erlwb8PBZA== X-Received: by 2002:a05:6a00:21cf:b0:728:15fd:dabb with SMTP id d2e1a72fcca58-734140c445fmr23521b3a.8.1739985382990; Wed, 19 Feb 2025 09:16:22 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-73265f98e18sm8926220b3a.106.2025.02.19.09.16.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Feb 2025 09:16:22 -0800 (PST) From: Stephen Hemminger To: stable@dpdk.org Cc: Stephen Hemminger Subject: [PATCH 23.11] examples/ptpclient: fix message parsing Date: Wed, 19 Feb 2025 09:16:05 -0800 Message-ID: <20250219171612.506172-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.47.2 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 [ upstream commit 19630bd0d735badb06143086d4f1c50d726b7bad ] 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") 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 cdf2da64df..92b54f240e 100644 --- a/examples/ptpclient/ptpclient.c +++ b/examples/ptpclient/ptpclient.c @@ -365,7 +365,7 @@ parse_sync(struct ptpv2_data_slave_ordinary *ptp_data, uint16_t rx_tstamp_idx) ptp_data->ptpset = 1; } - if (memcmp(&ptp_hdr->source_port_id.clock_id, + if (memcmp(&ptp_hdr->master_clock_id, &ptp_hdr->source_port_id.clock_id, sizeof(struct clock_id)) == 0) { -- 2.47.2