diff options
| author | David Gibson <david@gibson.dropbear.id.au> | 2025-02-19 14:14:28 +1100 |
|---|---|---|
| committer | Stefano Brivio <sbrivio@redhat.com> | 2025-02-19 06:35:41 +0100 |
| commit | 1cc5d4c9fe0a84d3d39fc07358996989ca1b5875 (patch) | |
| tree | dc92381c2d4c9706de55a257b95b353b2b990954 /contrib/qemu | |
| parent | 3dc7da68a2731f661d7251a5fc759daffe24ca70 (diff) | |
| download | passt-1cc5d4c9fe0a84d3d39fc07358996989ca1b5875.tar passt-1cc5d4c9fe0a84d3d39fc07358996989ca1b5875.tar.gz passt-1cc5d4c9fe0a84d3d39fc07358996989ca1b5875.tar.bz2 passt-1cc5d4c9fe0a84d3d39fc07358996989ca1b5875.tar.lz passt-1cc5d4c9fe0a84d3d39fc07358996989ca1b5875.tar.xz passt-1cc5d4c9fe0a84d3d39fc07358996989ca1b5875.tar.zst passt-1cc5d4c9fe0a84d3d39fc07358996989ca1b5875.zip | |
conf: Use 0 instead of -1 as "unassigned" mtu value
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>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'contrib/qemu')
0 files changed, 0 insertions, 0 deletions
