summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1998-02-25 23:44:57 +0000
committerderaadt <deraadt@openbsd.org>1998-02-25 23:44:57 +0000
commit4ee44e3c09cf204b433352597a6e0454522f79bc (patch)
treeccc161290d2656d279a1d308551598400810d679
parentcheck for zerodev special case before kicking out all VCHR cases (diff)
downloadwireguard-openbsd-4ee44e3c09cf204b433352597a6e0454522f79bc.tar.xz
wireguard-openbsd-4ee44e3c09cf204b433352597a6e0454522f79bc.zip
patch could not have been tested. panics machine on boot
-rw-r--r--sys/netinet/in.c21
-rw-r--r--sys/netinet/tcp_usrreq.c10
2 files changed, 5 insertions, 26 deletions
diff --git a/sys/netinet/in.c b/sys/netinet/in.c
index e055aef80e6..6a16d587172 100644
--- a/sys/netinet/in.c
+++ b/sys/netinet/in.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in.c,v 1.6 1998/02/25 11:17:42 deraadt Exp $ */
+/* $OpenBSD: in.c,v 1.7 1998/02/25 23:44:57 deraadt Exp $ */
/* $NetBSD: in.c,v 1.26 1996/02/13 23:41:39 christos Exp $ */
/*
@@ -431,32 +431,19 @@ in_broadcast(in, ifp)
struct in_addr in;
struct ifnet *ifp;
{
- struct ifnet *ifn, *if_first, *if_target;
register struct ifaddr *ifa;
if (in.s_addr == INADDR_BROADCAST ||
in.s_addr == INADDR_ANY)
return 1;
- if (ifp && ((ifp->if_flags & IFF_BROADCAST) == 0))
+ if ((ifp->if_flags & IFF_BROADCAST) == 0)
return 0;
-
- if (ifp == NULL) {
- if_first = ifnet.tqh_first;
- if_target = 0;
- } else {
- if_first = ifp;
- if_target = ifp->if_list.tqe_next;
- }
-
-#define ia (ifatoia(ifa))
/*
* Look through the list of addresses for a match
* with a broadcast address.
- * If ifp is NULL, check against all the local interfaces.
*/
- for (ifn = if_first; ifn != if_target; ifn = ifn->if_list.tqe_next)
- for (ifa = ifn->if_addrlist.tqh_first; ifa;
- ifa = ifa->ifa_list.tqe_next)
+#define ia (ifatoia(ifa))
+ for (ifa = ifp->if_addrlist.tqh_first; ifa; ifa = ifa->ifa_list.tqe_next)
if (ifa->ifa_addr->sa_family == AF_INET &&
(in.s_addr == ia->ia_broadaddr.sin_addr.s_addr ||
in.s_addr == ia->ia_netbroadcast.s_addr ||
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index 1b3a11cfc90..6956fc9c7a7 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_usrreq.c,v 1.18 1998/02/25 11:17:43 deraadt Exp $ */
+/* $OpenBSD: tcp_usrreq.c,v 1.19 1998/02/25 23:44:58 deraadt Exp $ */
/* $NetBSD: tcp_usrreq.c,v 1.20 1996/02/13 23:44:16 christos Exp $ */
/*
@@ -90,7 +90,6 @@ tcp_usrreq(so, req, m, nam, control)
int req;
struct mbuf *m, *nam, *control;
{
- struct sockaddr_in *sin = mtod(nam, struct sockaddr_in *);
register struct inpcb *inp;
register struct tcpcb *tp = NULL;
int s;
@@ -190,12 +189,6 @@ tcp_usrreq(so, req, m, nam, control)
* Send initial segment on connection.
*/
case PRU_CONNECT:
- /* Trying to connect to some broadcast address */
- if (in_broadcast(sin->sin_addr, NULL)) {
- error = EINVAL;
- break;
- }
-
if (inp->inp_lport == 0) {
error = in_pcbbind(inp, NULL);
if (error)
@@ -204,7 +197,6 @@ tcp_usrreq(so, req, m, nam, control)
error = in_pcbconnect(inp, nam);
if (error)
break;
-
tp->t_template = tcp_template(tp);
if (tp->t_template == 0) {
in_pcbdisconnect(inp);