diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2013-01-16 00:07:23 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2013-01-16 00:07:23 +0000 |
commit | 6ca95d45797d24ff488e406ed91542ec581c796a (patch) | |
tree | 7743985ea1d4e9f33d0da1f40fb466a6f26e3d73 | |
parent | 222faf1403f48ae9b3bba9ed20b856a0bcb512bc (diff) |
Pass struct inpcb pointer to in_pcb...() functions instead of void
pointer. Allows stricter type checking. No functional change.
OK claudio@
-rw-r--r-- | sys/netinet/in_pcb.c | 18 | ||||
-rw-r--r-- | sys/netinet/in_pcb.h | 12 |
2 files changed, 12 insertions, 18 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index f3a6147d977..bcda9092012 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in_pcb.c,v 1.128 2012/09/20 10:25:03 blambert Exp $ */ +/* $OpenBSD: in_pcb.c,v 1.129 2013/01/16 00:07:22 bluhm Exp $ */ /* $NetBSD: in_pcb.c,v 1.25 1996/02/13 23:41:53 christos Exp $ */ /* @@ -172,9 +172,8 @@ in_baddynamic(u_int16_t port, u_int16_t proto) } int -in_pcballoc(struct socket *so, void *v) +in_pcballoc(struct socket *so, struct inpcbtable *table) { - struct inpcbtable *table = v; struct inpcb *inp; int s; @@ -218,9 +217,8 @@ in_pcballoc(struct socket *so, void *v) } int -in_pcbbind(void *v, struct mbuf *nam, struct proc *p) +in_pcbbind(struct inpcb *inp, struct mbuf *nam, struct proc *p) { - struct inpcb *inp = v; struct socket *so = inp->inp_socket; struct inpcbtable *table = inp->inp_table; u_int16_t *lastport = &inp->inp_table->inpt_lastport; @@ -372,9 +370,8 @@ in_pcbbind(void *v, struct mbuf *nam, struct proc *p) * then pick one. */ int -in_pcbconnect(void *v, struct mbuf *nam) +in_pcbconnect(struct inpcb *inp, struct mbuf *nam) { - struct inpcb *inp = v; struct sockaddr_in *ifaddr = NULL; struct sockaddr_in *sin = mtod(nam, struct sockaddr_in *); @@ -444,10 +441,8 @@ in_pcbconnect(void *v, struct mbuf *nam) } void -in_pcbdisconnect(void *v) +in_pcbdisconnect(struct inpcb *inp) { - struct inpcb *inp = v; - switch (sotopf(inp->inp_socket)) { #ifdef INET6 case PF_INET6: @@ -466,9 +461,8 @@ in_pcbdisconnect(void *v) } void -in_pcbdetach(void *v) +in_pcbdetach(struct inpcb *inp) { - struct inpcb *inp = v; struct socket *so = inp->inp_socket; int s; diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h index 9357981d112..60efda184af 100644 --- a/sys/netinet/in_pcb.h +++ b/sys/netinet/in_pcb.h @@ -1,4 +1,4 @@ -/* $OpenBSD: in_pcb.h,v 1.74 2012/10/21 13:06:03 benno Exp $ */ +/* $OpenBSD: in_pcb.h,v 1.75 2013/01/16 00:07:22 bluhm Exp $ */ /* $NetBSD: in_pcb.h,v 1.14 1996/02/13 23:42:00 christos Exp $ */ /* @@ -250,11 +250,11 @@ struct baddynamicports { #define sotopf(so) (so->so_proto->pr_domain->dom_family) void in_losing(struct inpcb *); -int in_pcballoc(struct socket *, void *); -int in_pcbbind(void *, struct mbuf *, struct proc *); -int in_pcbconnect(void *, struct mbuf *); -void in_pcbdetach(void *); -void in_pcbdisconnect(void *); +int in_pcballoc(struct socket *, struct inpcbtable *); +int in_pcbbind(struct inpcb *, struct mbuf *, struct proc *); +int in_pcbconnect(struct inpcb *, struct mbuf *); +void in_pcbdetach(struct inpcb *); +void in_pcbdisconnect(struct inpcb *); struct inpcb * in_pcbhashlookup(struct inpcbtable *, struct in_addr, u_int, struct in_addr, u_int, u_int); |