Index: tcp_usrreq.c =================================================================== --- tcp_usrreq.c +++ tcp_usrreq.c @@ -542,6 +542,10 @@ if (sinp->sin_family == AF_INET && IN_MULTICAST(ntohl(sinp->sin_addr.s_addr))) return (EAFNOSUPPORT); + if ((sinp->sin_family == AF_INET) && + ((ntohl(sinp->sin_addr.s_addr) == 0xffffffff) || + (sinp->sin_addr.s_addr == 0))) + return(EAFNOSUPPORT); if ((error = prison_remote_ip4(td->td_ucred, &sinp->sin_addr)) != 0) return (error); @@ -642,6 +646,11 @@ error = EAFNOSUPPORT; goto out; } + if ((ntohl(sin.sin_addr.s_addr) == 0xffffffff) || + (sin.sin_addr.s_addr == 0)) { + error = EAFNOSUPPORT; + goto out; + } if ((error = prison_remote_ip4(td->td_ucred, &sin.sin_addr)) != 0) goto out; @@ -1014,6 +1023,13 @@ error = EAFNOSUPPORT; goto out; } + if ((ntohl(sinp->sin_addr.s_addr) == 0xffffffff) || + (sinp->sin_addr.s_addr == 0)) { + if (m) + m_freem(m); + error = EAFNOSUPPORT; + goto out; + } if ((error = prison_remote_ip4(td->td_ucred, &sinp->sin_addr))) { if (m)