summaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1999-01-07 06:05:06 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1999-01-07 06:05:06 +0000
commit05408b7afa903b5486b1034af6a525057e9b4e96 (patch)
tree47452b5d27a99a3be16fbcc7d3e943bbb2b28237 /sys/netinet
parent295ce5eae351f319add00a5414929fe54cbdef05 (diff)
in_pcblookup() now takes ptr to both ip address arguments
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/in_pcb.c24
-rw-r--r--sys/netinet/in_pcb.h6
-rw-r--r--sys/netinet/tcp_input.c6
-rw-r--r--sys/netinet/tcp_usrreq.c6
-rw-r--r--sys/netinet/udp_usrreq.c6
5 files changed, 25 insertions, 23 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c
index 9656d5448a1..37c41804e46 100644
--- a/sys/netinet/in_pcb.c
+++ b/sys/netinet/in_pcb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in_pcb.c,v 1.25 1999/01/07 05:44:31 deraadt Exp $ */
+/* $OpenBSD: in_pcb.c,v 1.26 1999/01/07 06:05:04 deraadt Exp $ */
/* $NetBSD: in_pcb.c,v 1.25 1996/02/13 23:41:53 christos Exp $ */
/*
@@ -205,13 +205,13 @@ in_pcbbind(v, nam)
(error = suser(p->p_ucred, &p->p_acflag)))
return (EACCES);
if (so->so_euid) {
- t = in_pcblookup(table, zeroin_addr, 0,
- sin->sin_addr, lport, INPLOOKUP_WILDCARD);
+ t = in_pcblookup(table, &zeroin_addr, 0,
+ &sin->sin_addr, lport, INPLOOKUP_WILDCARD);
if (t && (so->so_euid != t->inp_socket->so_euid))
return (EADDRINUSE);
}
- t = in_pcblookup(table, zeroin_addr, 0,
- sin->sin_addr, lport, wild);
+ t = in_pcblookup(table, &zeroin_addr, 0,
+ &sin->sin_addr, lport, wild);
if (t && (reuseport & t->inp_socket->so_options) == 0)
return (EADDRINUSE);
}
@@ -269,8 +269,8 @@ portloop:
*lastport = first;
lport = htons(*lastport);
} while (in_baddynamic(*lastport, so->so_proto->pr_protocol) ||
- in_pcblookup(table, zeroin_addr, 0,
- inp->inp_laddr, lport, wild));
+ in_pcblookup(table, &zeroin_addr, 0,
+ &inp->inp_laddr, lport, wild));
} else {
/*
* counting up
@@ -296,8 +296,8 @@ portloop:
*lastport = first;
lport = htons(*lastport);
} while (in_baddynamic(*lastport, so->so_proto->pr_protocol) ||
- in_pcblookup(table, zeroin_addr, 0,
- inp->inp_laddr, lport, wild));
+ in_pcblookup(table, &zeroin_addr, 0,
+ &inp->inp_laddr, lport, wild));
}
}
inp->inp_lport = lport;
@@ -630,15 +630,17 @@ in_rtchange(inp, errno)
}
struct inpcb *
-in_pcblookup(table, faddr, fport_arg, laddr, lport_arg, flags)
+in_pcblookup(table, faddrp, fport_arg, laddrp, lport_arg, flags)
struct inpcbtable *table;
- struct in_addr faddr, laddr;
+ void *faddrp, *laddrp;
u_int fport_arg, lport_arg;
int flags;
{
register struct inpcb *inp, *match = 0;
int matchwild = 3, wildcard;
u_int16_t fport = fport_arg, lport = lport_arg;
+ struct in_addr faddr = *(struct in_addr *)faddrp;
+ struct in_addr laddr = *(struct in_addr *)laddrp;
for (inp = table->inpt_queue.cqh_first;
inp != (struct inpcb *)&table->inpt_queue;
diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h
index 9cb91e53369..9aec9b0c74f 100644
--- a/sys/netinet/in_pcb.h
+++ b/sys/netinet/in_pcb.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: in_pcb.h,v 1.11 1999/01/07 05:44:32 deraadt Exp $ */
+/* $OpenBSD: in_pcb.h,v 1.12 1999/01/07 06:05:04 deraadt Exp $ */
/* $NetBSD: in_pcb.h,v 1.14 1996/02/13 23:42:00 christos Exp $ */
/*
@@ -120,8 +120,8 @@ struct inpcb *
u_int, struct in_addr, u_int));
void in_pcbinit __P((struct inpcbtable *, int));
struct inpcb *
- in_pcblookup __P((struct inpcbtable *,
- struct in_addr, u_int, struct in_addr, u_int, int));
+ in_pcblookup __P((struct inpcbtable *, void *, u_int, void *,
+ u_int, int));
void in_pcbnotify __P((struct inpcbtable *, struct sockaddr *,
u_int, struct in_addr, u_int, int, void (*)(struct inpcb *, int)));
void in_pcbnotifyall __P((struct inpcbtable *, struct sockaddr *,
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index 1f2edfc9c3a..e08dd29ed12 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_input.c,v 1.22 1998/11/25 05:44:36 millert Exp $ */
+/* $OpenBSD: tcp_input.c,v 1.23 1999/01/07 06:05:04 deraadt Exp $ */
/* $NetBSD: tcp_input.c,v 1.23 1996/02/13 23:43:44 christos Exp $ */
/*
@@ -528,8 +528,8 @@ findpcb:
ti->ti_dst, ti->ti_dport);
if (inp == 0) {
++tcpstat.tcps_pcbhashmiss;
- inp = in_pcblookup(&tcbtable, ti->ti_src, ti->ti_sport,
- ti->ti_dst, ti->ti_dport, INPLOOKUP_WILDCARD);
+ inp = in_pcblookup(&tcbtable, &ti->ti_src, ti->ti_sport,
+ &ti->ti_dst, ti->ti_dport, INPLOOKUP_WILDCARD);
/*
* If the state is CLOSED (i.e., TCB does not exist) then
* all data in the incoming segment is discarded.
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index 77373050341..02cb808c772 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_usrreq.c,v 1.30 1999/01/07 05:52:26 deraadt Exp $ */
+/* $OpenBSD: tcp_usrreq.c,v 1.31 1999/01/07 06:05:05 deraadt Exp $ */
/* $NetBSD: tcp_usrreq.c,v 1.20 1996/02/13 23:44:16 christos Exp $ */
/*
@@ -635,8 +635,8 @@ tcp_ident(oldp, oldlenp, newp, newlen)
lin->sin_addr, lin->sin_port);
if (inp == NULL) {
++tcpstat.tcps_pcbhashmiss;
- inp = in_pcblookup(&tcbtable, fin->sin_addr, fin->sin_port,
- lin->sin_addr, lin->sin_port, 0);
+ inp = in_pcblookup(&tcbtable, &fin->sin_addr, fin->sin_port,
+ &lin->sin_addr, lin->sin_port, 0);
}
if (inp != NULL && (inp->inp_socket->so_state & SS_CONNECTOUT)) {
tir.ruid = inp->inp_socket->so_ruid;
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
index b248fcd48ee..e3f173c79e3 100644
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: udp_usrreq.c,v 1.17 1998/12/31 11:16:55 deraadt Exp $ */
+/* $OpenBSD: udp_usrreq.c,v 1.18 1999/01/07 06:05:05 deraadt Exp $ */
/* $NetBSD: udp_usrreq.c,v 1.28 1996/03/16 23:54:03 christos Exp $ */
/*
@@ -281,8 +281,8 @@ udp_input(m, va_alist)
ip->ip_dst, uh->uh_dport);
if (inp == 0) {
++udpstat.udps_pcbhashmiss;
- inp = in_pcblookup(&udbtable, ip->ip_src, uh->uh_sport,
- ip->ip_dst, uh->uh_dport, INPLOOKUP_WILDCARD);
+ inp = in_pcblookup(&udbtable, &ip->ip_src, uh->uh_sport,
+ &ip->ip_dst, uh->uh_dport, INPLOOKUP_WILDCARD);
if (inp == 0) {
udpstat.udps_noport++;
if (m->m_flags & (M_BCAST | M_MCAST)) {