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 01B1245D0B for ; Fri, 15 Nov 2024 07:08:09 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B9F8442F7E; Fri, 15 Nov 2024 07:08:05 +0100 (CET) Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by mails.dpdk.org (Postfix) with ESMTP id 8F61D42F9F for ; Fri, 15 Nov 2024 07:07:59 +0100 (CET) Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-20c70abba48so15184295ad.0 for ; Thu, 14 Nov 2024 22:07:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1731650879; x=1732255679; 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=h2yLbrmHFqqNfBqSugArqks++q8pU+/0fvb1Fi3D9YIUYWSGnvRlab+hs8l85Rdob+ //kElOSrLpe/Jbby5tDJlrhNl6bJO/Q6E/mCZ4TLuv4VsiLqkND0OiYzAtSGDwvkubcb vX/Dp/Xkf+ynV8vVNjm6kWorTNs9I1CT99bfNHE8Yd2gJ3x0clcewJcoPjsF2C+OU2Ah hwGbPTRTb0Rcl7GLwdFlUY5LhnylC6DrPd9kSPFLnFCxCPP8Ei0RZkLAmvR3p+ldc2br ZxnmrgIp4l95Nj/pwIutuOK5KVlMPvpLV7FRPLj22CDpvtPwzpZaOAIlC4eDyQJ+y+Ds XINA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731650879; x=1732255679; 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=Jvxynr66gt3EwmfTW8np2qW+pNAVFftLg9OUe5PLwo7xDGndP/RRxv41qP+gKXGeAX 1YsJ1qw+IEkmoUCgpbpjE/R/U1gZkUebIKHaQsUTk89rUp1UQD7nCruO1pj1qanlg+Bj yA1QTpd47z0QqFSEDjLJ/aYlVfn0hzX+EY0RuymOqXqe7vLGY7PDru9o5K6k6SzGqJIF 8emkAhdEZfpYKU6EBeSmWiRM17inekwIUPk5qetrC0XDQ2KEfREznmiz4nj2xeeGRyIM p9WH7AgOOOKDKDWtTkJkCC8tWJt5M62eUeyB9D12QgnB6Rg2uXFnc1sN8EIx6P+Hmnj0 u6KA== X-Forwarded-Encrypted: i=1; AJvYcCUz2Vdsw8Czut2N94u5Zv5wDs2Awippkjikf7dXytYBzMec9XLidJgXF2KLtlpgGB3jURMqS1Y=@dpdk.org X-Gm-Message-State: AOJu0YxfotBTyqkk9N0RuFljfHOjx42t55b176KxLgrXBgV+Xj7/L0ca Ucbw/XDJ+RKiArq4H0ouzgw49dsIx2rL2RC46AJGSA65YeZ0esEBIwVqTwnKCDk= X-Google-Smtp-Source: AGHT+IG1YFKbr4dGGjMZTrSgQ6BrDO+TPxqEDG+bppVen9CiWljGrR29Cl6NQ7pcPZkioOkR1bcXYQ== X-Received: by 2002:a05:6a21:a105:b0:1db:eb51:bac5 with SMTP id adf61e73a8af0-1dc90bb39e1mr2035847637.31.1731650878316; Thu, 14 Nov 2024 22:07:58 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ea06f4856esm2123781a91.23.2024.11.14.22.07.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Nov 2024 22:07:57 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , danielx.t.mrzyglod@intel.com, stable@dpdk.org, Kirill Rybalchenko , John McNamara , Pablo de Lara Subject: [PATCH 09/16] examples/ptpclient: fix self memcmp Date: Thu, 14 Nov 2024 22:05:46 -0800 Message-ID: <20241115060738.313190-10-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241115060738.313190-1-stephen@networkplumber.org> References: <20241115060738.313190-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