diff options
Diffstat (limited to 'sys/netinet/tcp_usrreq.c')
-rw-r--r-- | sys/netinet/tcp_usrreq.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index e53d2b40a98..2abcefd468b 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_usrreq.c,v 1.25 1998/06/26 18:07:30 deraadt Exp $ */ +/* $OpenBSD: tcp_usrreq.c,v 1.26 1998/06/27 02:09:46 angelos Exp $ */ /* $NetBSD: tcp_usrreq.c,v 1.20 1996/02/13 23:44:16 christos Exp $ */ /* @@ -198,6 +198,13 @@ tcp_usrreq(so, req, m, nam, control) case PRU_CONNECT: sin = mtod(nam, struct sockaddr_in *); + /* Disallow connects to a multicast address */ + if (IN_MULTICAST(sin->sin_addr.s_addr)) + { + error = EINVAL; + break; + } + /* Trying to connect to some broadcast address */ if (in_broadcast(sin->sin_addr, NULL)) { error = EINVAL; |