DPDK patches and discussions
 help / color / mirror / Atom feed
From: Luca Boccassi <bluca@debian.org>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: dev@dpdk.org, Reshma Pattan <reshma.pattan@intel.com>
Subject: Re: [PATCH] test: fix 32 bit overflow in pcapng test
Date: Thu, 18 Jul 2024 20:07:29 +0100	[thread overview]
Message-ID: <CAMw=ZnSqhygtTo+jLe3jt9QRSOXMxDgwbta-oJyC6QBBQcByZw@mail.gmail.com> (raw)
In-Reply-To: <20240718174253.16346-1-stephen@networkplumber.org>

On Thu, 18 Jul 2024 at 18:43, Stephen Hemminger
<stephen@networkplumber.org> 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 <bluca@debian.org>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
>  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 <bluca@debian.org>

  reply	other threads:[~2024-07-18 19:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-18 17:42 Stephen Hemminger
2024-07-18 19:07 ` Luca Boccassi [this message]
2024-07-29 16:33   ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMw=ZnSqhygtTo+jLe3jt9QRSOXMxDgwbta-oJyC6QBBQcByZw@mail.gmail.com' \
    --to=bluca@debian.org \
    --cc=dev@dpdk.org \
    --cc=reshma.pattan@intel.com \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).