From: Stefano Brivio <sbrivio@redhat.com>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: passt-dev@passt.top
Subject: Re: [PATCH 2/3] conf: Use 0 instead of -1 as "unassigned" mtu value
Date: Wed, 19 Feb 2025 07:56:38 +0100 [thread overview]
Message-ID: <20250219075638.300fd87f@elisabeth> (raw)
In-Reply-To: <20250219031429.3708026-3-david@gibson.dropbear.id.au>
On Wed, 19 Feb 2025 14:14:28 +1100
David Gibson <david@gibson.dropbear.id.au> wrote:
> On the command line -m 0 means "don't assign an MTU" (letting the guest use
> its default. However, internally we use (c->mtu == -1) to represent that
> state. We use (c->mtu == 0) to represent "the user didn't specify on the
> command line, so use the default" - but this is only used during conf(),
> never afterwards.
>
> This is unnecessarily confusing. We can instead just initialise c->mtu to
> its default (65520) before parsing options and use 0 on both the command
> line and internally to represent the "don't assign" special case. This
> ensures that c->mtu is always 0..65535, so we can store it in a uint16_t
> which is more natural.
>
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Applied.
--
Stefano
next prev parent 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
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 [this message]
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=20250219075638.300fd87f@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).