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 487D345648; Thu, 18 Jul 2024 21:07:45 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 134234069D; Thu, 18 Jul 2024 21:07:45 +0200 (CEST) Received: from mail-yw1-f172.google.com (mail-yw1-f172.google.com [209.85.128.172]) by mails.dpdk.org (Postfix) with ESMTP id 26DB94029B for ; Thu, 18 Jul 2024 21:07:43 +0200 (CEST) Received: by mail-yw1-f172.google.com with SMTP id 00721157ae682-663dd13c0bbso12519227b3.1 for ; Thu, 18 Jul 2024 12:07:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721329662; x=1721934462; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=H6aybgGySHtzyjmn/Pwgb2okqFPEn2Wxa/+9vUmIIHI=; b=oPWKLGhuURqPB9jdRw2uNodFxoCD7XzEELMzkbnrbIN7GowyWseb/aQs08y+i2TnCj QTMckKcjRQRqymJE86nxR0hmuUc+/CfBaQsvqMpLa3aTEsNMtSu9DDE7WwiY70nWZSuS iY/TGMtepXMOr2KgShFkXtNPad3nC9On6t/fxtepHtid3dBwZ2pAjg8O1690bIUwC6e6 OMKxhOvU5GEUWvuVI4xOyWHMQyXAqHl3r4bIVkQVf6x1VQJYRgJ0jmcecz7WQ6gYbg8n ik5OSbezo26NrXdag+i7h9NcUIq4tmGHe/lgTvWx6bAs/yV7UQTeZIYPs9XjLw+pwwUD fbQg== X-Gm-Message-State: AOJu0YzVTTi0HilI7SBpucMepEy95Xp8hmqJxxsJ/3QQ07funjkkpCvh DnrolV5FMaJCjAj8ynamIPpyV+yd+3gYyvUdA5YDl7cZqIgbvYWk0kx6OiC6 X-Google-Smtp-Source: AGHT+IFBhvMfSjqrTOAXWdZ8+ESQ6lJBivv1M2Vsl42cjh6J02ZD123u1Fs7QY33V0T4p9H0L3FZIA== X-Received: by 2002:a81:9f0a:0:b0:664:73d2:fc83 with SMTP id 00721157ae682-666a1c1c755mr28415647b3.15.1721329662268; Thu, 18 Jul 2024 12:07:42 -0700 (PDT) Received: from mail-yw1-f169.google.com (mail-yw1-f169.google.com. [209.85.128.169]) by smtp.gmail.com with ESMTPSA id 00721157ae682-666038f5e2dsm4582197b3.77.2024.07.18.12.07.41 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 18 Jul 2024 12:07:41 -0700 (PDT) Received: by mail-yw1-f169.google.com with SMTP id 00721157ae682-663dd13c0bbso12518827b3.1 for ; Thu, 18 Jul 2024 12:07:41 -0700 (PDT) X-Received: by 2002:a05:690c:2905:b0:648:857c:1530 with SMTP id 00721157ae682-666a5b80510mr31814297b3.34.1721329661724; Thu, 18 Jul 2024 12:07:41 -0700 (PDT) MIME-Version: 1.0 References: <20240718174253.16346-1-stephen@networkplumber.org> In-Reply-To: <20240718174253.16346-1-stephen@networkplumber.org> From: Luca Boccassi Date: Thu, 18 Jul 2024 20:07:29 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] test: fix 32 bit overflow in pcapng test To: Stephen Hemminger Cc: dev@dpdk.org, Reshma Pattan Content-Type: text/plain; charset="UTF-8" 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 On Thu, 18 Jul 2024 at 18:43, Stephen Hemminger wrote: > > The conversion from seconds to nanoseconds in the pcapng test > would overflow on 32 bit platforms leading to this test failing. > > Reported-by: Luca Boccassi > Signed-off-by: Stephen Hemminger > --- > app/test/test_pcapng.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/app/test/test_pcapng.c b/app/test/test_pcapng.c > index 89535efad0..2665b08c76 100644 > --- a/app/test/test_pcapng.c > +++ b/app/test/test_pcapng.c > @@ -235,7 +235,7 @@ parse_pcap_packet(u_char *user, const struct pcap_pkthdr *h, > * but the file is open in nanonsecond mode therefore > * the timestamp is really in timespec (ie. nanoseconds). > */ > - ns = h->ts.tv_sec * NS_PER_S + h->ts.tv_usec; > + ns = (uint64_t)h->ts.tv_sec * NS_PER_S + h->ts.tv_usec; > if (ns < ctx->start_ns || ns > ctx->end_ns) { > char tstart[128], tend[128]; Thanks this fixes the issue, the build is now green Tested-by: Luca Boccassi