IPv4: correct limit on loopback_prefix
Commit efe58855f3
allowed the net.inet.ip.loopback_prefix value
to be 32. However, with a 32-bit mask, 127.0.0.1 is not included
in the reserved loopback range, which should not be allowed.
Change the max prefix length to 31.
This commit is contained in:
parent
e89841f893
commit
fb8ef16bab
|
@ -297,7 +297,7 @@ sysctl_loopback_prefixlen(SYSCTL_HANDLER_ARGS)
|
||||||
error = sysctl_handle_int(oidp, &preflen, 0, req);
|
error = sysctl_handle_int(oidp, &preflen, 0, req);
|
||||||
if (error || !req->newptr)
|
if (error || !req->newptr)
|
||||||
return (error);
|
return (error);
|
||||||
if (preflen < 8 || preflen > 32)
|
if (preflen < 8 || preflen > 31)
|
||||||
return (EINVAL);
|
return (EINVAL);
|
||||||
V_in_loopback_mask = 0xffffffff << (32 - preflen);
|
V_in_loopback_mask = 0xffffffff << (32 - preflen);
|
||||||
return (0);
|
return (0);
|
||||||
|
|
Loading…
Reference in New Issue