mirror of
https://passt.top/passt
synced 2025-02-22 02:42:22 +00:00
conf: Fix mask calculation from prefix_len in conf_print()
Reported-by: Paul Holzinger <pholzing@redhat.com> Fixes: dd09cceaee21 ("Minor improvements to IPv4 netmask handling") Signed-off-by: Stefano Brivio <sbrivio@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
817eedc28a
commit
4129764eca
5
conf.c
5
conf.c
@ -884,7 +884,10 @@ static void conf_print(const struct ctx *c)
|
||||
|
||||
if (c->ifi4) {
|
||||
if (!c->no_dhcp) {
|
||||
uint32_t mask = htonl(0xffffffff << c->ip4.prefix_len);
|
||||
uint32_t mask;
|
||||
|
||||
mask = htonl(0xffffffff << (32 - c->ip4.prefix_len));
|
||||
|
||||
info("DHCP:");
|
||||
info(" assign: %s",
|
||||
inet_ntop(AF_INET, &c->ip4.addr, buf4, sizeof(buf4)));
|
||||
|
Loading…
x
Reference in New Issue
Block a user