diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2013-03-29 13:16:15 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2013-03-29 13:16:15 +0000 |
commit | 4689d80b9a3dac1595ad5514461cd7a3147f9f9b (patch) | |
tree | 13fd6111dffcea4b711df185d2c74a7ef56a383f /sys/netinet | |
parent | 479167afe8afba5cc139b3e52d350f7e4cfb70e9 (diff) |
Declare struct pf_state_key in the mbuf and in_pcb header files to
avoid ugly casts.
OK krw@ tedu@
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/in_pcb.c | 4 | ||||
-rw-r--r-- | sys/netinet/in_pcb.h | 6 | ||||
-rw-r--r-- | sys/netinet/ip_input.c | 4 | ||||
-rw-r--r-- | sys/netinet/tcp_input.c | 9 | ||||
-rw-r--r-- | sys/netinet/udp_usrreq.c | 7 |
5 files changed, 15 insertions, 15 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index b0882f574bb..cf64629aaf5 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: in_pcb.c,v 1.133 2013/03/28 12:06:55 mpi Exp $ */ +/* $OpenBSD: in_pcb.c,v 1.134 2013/03/29 13:16:14 bluhm Exp $ */ /* $NetBSD: in_pcb.c,v 1.25 1996/02/13 23:41:53 christos Exp $ */ /* @@ -500,7 +500,7 @@ in_pcbdetach(struct inpcb *inp) #endif #if NPF > 0 if (inp->inp_pf_sk) - ((struct pf_state_key *)inp->inp_pf_sk)->inp = NULL; + inp->inp_pf_sk->inp = NULL; #endif s = splnet(); LIST_REMOVE(inp, inp_lhash); diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h index f5e75369970..e47636e7121 100644 --- a/sys/netinet/in_pcb.h +++ b/sys/netinet/in_pcb.h @@ -1,4 +1,4 @@ -/* $OpenBSD: in_pcb.h,v 1.76 2013/03/14 11:18:37 mpi Exp $ */ +/* $OpenBSD: in_pcb.h,v 1.77 2013/03/29 13:16:14 bluhm Exp $ */ /* $NetBSD: in_pcb.h,v 1.14 1996/02/13 23:42:00 christos Exp $ */ /* @@ -70,6 +70,8 @@ #include <netinet/icmp6.h> #include <netinet/ip_ipsp.h> +struct pf_state_key; + union inpaddru { struct in6_addr iau_addr6; struct { @@ -145,7 +147,7 @@ struct inpcb { #define inp_csumoffset in6p_cksum #endif struct icmp6_filter *inp_icmp6filt; - void *inp_pf_sk; + struct pf_state_key *inp_pf_sk; u_int inp_rtableid; int inp_pipex; /* pipex indication */ int inp_divertfl; /* divert flags */ diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index b99460f2523..9ff92af4a50 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_input.c,v 1.205 2013/03/28 16:45:16 tedu Exp $ */ +/* $OpenBSD: ip_input.c,v 1.206 2013/03/29 13:16:14 bluhm Exp $ */ /* $NetBSD: ip_input.c,v 1.30 1996/03/16 23:53:58 christos Exp $ */ /* @@ -672,7 +672,7 @@ in_ouraddr(struct in_addr ina, struct mbuf *m) if (m->m_pkthdr.pf.flags & PF_TAG_DIVERTED) return (1); - key = (struct pf_state_key *)m->m_pkthdr.pf.statekey; + key = m->m_pkthdr.pf.statekey; if (key != NULL) { if (key->inp != NULL) return (1); diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 2bd8a50609f..e3dba6a0cda 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_input.c,v 1.257 2013/03/28 23:10:06 tedu Exp $ */ +/* $OpenBSD: tcp_input.c,v 1.258 2013/03/29 13:16:14 bluhm Exp $ */ /* $NetBSD: tcp_input.c,v 1.23 1996/02/13 23:43:44 christos Exp $ */ /* @@ -594,7 +594,7 @@ tcp_input(struct mbuf *m, ...) */ #if NPF > 0 if (m->m_pkthdr.pf.statekey) - inp = ((struct pf_state_key *)m->m_pkthdr.pf.statekey)->inp; + inp = m->m_pkthdr.pf.statekey->inp; #endif findpcb: if (inp == NULL) { @@ -613,8 +613,7 @@ findpcb: } #if NPF > 0 if (m->m_pkthdr.pf.statekey && inp) { - ((struct pf_state_key *)m->m_pkthdr.pf.statekey)->inp = - inp; + m->m_pkthdr.pf.statekey->inp = inp; inp->inp_pf_sk = m->m_pkthdr.pf.statekey; } #endif @@ -882,7 +881,7 @@ findpcb: #if NPF > 0 if (m->m_pkthdr.pf.statekey) { - ((struct pf_state_key *)m->m_pkthdr.pf.statekey)->inp = inp; + m->m_pkthdr.pf.statekey->inp = inp; inp->inp_pf_sk = m->m_pkthdr.pf.statekey; } /* The statekey has finished finding the inp, it is no longer needed. */ diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 0cd83e2ce43..6ca4df8ae57 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: udp_usrreq.c,v 1.154 2013/03/14 11:18:37 mpi Exp $ */ +/* $OpenBSD: udp_usrreq.c,v 1.155 2013/03/29 13:16:14 bluhm Exp $ */ /* $NetBSD: udp_usrreq.c,v 1.28 1996/03/16 23:54:03 christos Exp $ */ /* @@ -549,7 +549,7 @@ udp_input(struct mbuf *m, ...) */ #if 0 if (m->m_pkthdr.pf.statekey) - inp = ((struct pf_state_key *)m->m_pkthdr.pf.statekey)->inp; + inp = m->m_pkthdr.pf.statekey->inp; #endif if (inp == NULL) { #ifdef INET6 @@ -562,8 +562,7 @@ udp_input(struct mbuf *m, ...) ip->ip_dst, uh->uh_dport, m->m_pkthdr.rdomain); #if NPF > 0 if (m->m_pkthdr.pf.statekey && inp) { - ((struct pf_state_key *)m->m_pkthdr.pf.statekey)->inp = - inp; + m->m_pkthdr.pf.statekey->inp = inp; inp->inp_pf_sk = m->m_pkthdr.pf.statekey; } #endif |