diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2022-11-04 14:10:33 +1100 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2022-11-04 12:04:19 +0100 |
commit | dd09cceaee216afc90101ee5c3a2d57b1ca1a042 (patch) | |
tree | 357910fd41e5ab0a1a0038debd0b5c24739d14aa /dhcpv6.c | |
parent | 2b793d94ca353ac3071b5d9a75e73b64cc0c76ca (diff) | |
download | passt-dd09cceaee216afc90101ee5c3a2d57b1ca1a042.tar passt-dd09cceaee216afc90101ee5c3a2d57b1ca1a042.tar.gz passt-dd09cceaee216afc90101ee5c3a2d57b1ca1a042.tar.bz2 passt-dd09cceaee216afc90101ee5c3a2d57b1ca1a042.tar.lz passt-dd09cceaee216afc90101ee5c3a2d57b1ca1a042.tar.xz passt-dd09cceaee216afc90101ee5c3a2d57b1ca1a042.tar.zst passt-dd09cceaee216afc90101ee5c3a2d57b1ca1a042.zip |
Minor improvements to IPv4 netmask handling
There are several minor problems with our parsing of IPv4 netmasks (-n).
First, we don't reject nonsensical netmasks like 0.255.0.255. Address this
structurally by using prefix length instead of netmask as the primary
variable, only converting (and validating) when we need to. This has the
added benefit of making some things more uniform with the IPv6 path.
Second, when the user specifies a prefix length, we truncate the output
from strtol() to an integer, which means we would treat -n 4294967320 as
valid (equivalent to 24). Fix types to check for this.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'dhcpv6.c')
0 files changed, 0 insertions, 0 deletions