mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-21 18:50:50 +01:00
pfctl: improve bitmask printing
In some cases the netmask gets set to a full 128 bit mask even if no address family is selected; don't print the v6 mask if it's a v4 address. Obtained from: OpenBSD, mcbride <mcbride@openbsd.org>, f6d7b41f07 Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46584
This commit is contained in:
parent
03d11291d8
commit
e044f67a66
@ -128,7 +128,7 @@ print_addr(struct pf_addr_wrap *addr, sa_family_t af, int verbose)
|
||||
PF_AZERO(&addr->v.a.mask, AF_INET6))) {
|
||||
int bits = unmask(&addr->v.a.mask, af);
|
||||
|
||||
if (bits != (af == AF_INET ? 32 : 128))
|
||||
if (bits < (af == AF_INET ? 32 : 128))
|
||||
printf("/%d", bits);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user