mac_portacl: do not reject unspecific family directly

Reviewed by: imp,emaste
Pull Request: https://github.com/freebsd/freebsd-src/pull/1659
This commit is contained in:
K Rin
2025-04-12 10:28:52 +08:00
committed by Warner Losh
parent 9a6a2e4b7d
commit 6b61852b4f
+2 -1
View File
@@ -452,7 +452,8 @@ socket_check_bind(struct ucred *cred, struct socket *so,
return (0);
/* Reject addresses we don't understand; fail closed. */
if (sa->sa_family != AF_INET && sa->sa_family != AF_INET6)
if (sa->sa_family != AF_UNSPEC && sa->sa_family != AF_INET &&
sa->sa_family != AF_INET6)
return (EINVAL);
family = so->so_proto->pr_domain->dom_family;