public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: Stefano Brivio <sbrivio@redhat.com>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: passt-dev@passt.top
Subject: Re: [PATCH 1/3] conf: More thorough error checking when parsing --mtu option
Date: Wed, 19 Feb 2025 07:56:36 +0100	[thread overview]
Message-ID: <20250219075636.68df99aa@elisabeth> (raw)
In-Reply-To: <20250219031429.3708026-2-david@gibson.dropbear.id.au>

On Wed, 19 Feb 2025 14:14:27 +1100
David Gibson <david@gibson.dropbear.id.au> wrote:

> We're a bit sloppy with parsing MTU which can lead to some surprising,
> though fairly harmless, results:
>   * Passing a non-number like '-m xyz' will not give an error and act like
>     -m 0
>   * Junk after a number (e.g. '-m 1500pqr') will be ignored rather than
>     giving an error
>   * We parse the MTU as a long, then immediately assign to an int, so on
>     some platforms certain ludicrously out of bounds values will be
>     silently truncated, rather than giving an error
> 
> Be a bit more thorough with the error checking to avoid that.
> 
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>

Applied.

-- 
Stefano


  reply	other threads:[~2025-02-19  6:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-19  3:14 [PATCH 0/3] Improve validation of --mtu option David Gibson
2025-02-19  3:14 ` [PATCH 1/3] conf: More thorough error checking when parsing " David Gibson
2025-02-19  6:56   ` Stefano Brivio [this message]
2025-02-19  3:14 ` [PATCH 2/3] conf: Use 0 instead of -1 as "unassigned" mtu value David Gibson
2025-02-19  6:56   ` Stefano Brivio
2025-02-19  3:14 ` [PATCH 3/3] conf: Be more precise about minimum MTUs David Gibson
2025-02-19  5:37   ` Stefano Brivio
2025-02-20  3:55     ` David Gibson
2025-02-20  6:45       ` Stefano Brivio
2025-02-20 10:06         ` David Gibson
2025-02-20 10:14           ` Stefano Brivio

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=20250219075636.68df99aa@elisabeth \
    --to=sbrivio@redhat.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=passt-dev@passt.top \
    /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.
Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

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 IMAP folder(s).