summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authorkmacy <kmacy@FreeBSD.org>2008-07-21 22:11:39 +0000
committerkmacy <kmacy@FreeBSD.org>2008-07-21 22:11:39 +0000
commit887a78e4a470f3696639fe9f59dae6116cd858d3 (patch)
treea105a8c393fe16e57426089736762b204ac8474b /sys/netinet
parent9d2fb357513981bea44ed3d8410c91a5ce41149d (diff)
downloadFreeBSD-src-887a78e4a470f3696639fe9f59dae6116cd858d3.zip
FreeBSD-src-887a78e4a470f3696639fe9f59dae6116cd858d3.tar.gz
make new accessor functions consistent with existing style
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/in_pcb.c8
-rw-r--r--sys/netinet/in_pcb.h15
2 files changed, 14 insertions, 9 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c
index 10f22b3d..93edc73 100644
--- a/sys/netinet/in_pcb.c
+++ b/sys/netinet/in_pcb.c
@@ -1299,11 +1299,13 @@ inp_ip_tos_set(struct inpcb *inp, int val)
}
void
-inp_4tuple_get(const struct inpcb *inp, uint32_t *laddr, uint16_t *lp, uint32_t *faddr, uint16_t *fp)
+inp_4tuple_get(const struct inpcb *inp, uint32_t *laddr, uint16_t *lp,
+ uint32_t *faddr, uint16_t *fp)
{
- memcpy(laddr, &inp->inp_laddr, 4);
- memcpy(faddr, &inp->inp_faddr, 4);
+ INP_LOCK_ASSERT(inp);
+ *laddr = inp->inp_laddr;
+ *faddr = inp->inp_faddr;
*lp = inp->inp_lport;
*fp = inp->inp_fport;
}
diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h
index 66a6a41..02e5d2d 100644
--- a/sys/netinet/in_pcb.h
+++ b/sys/netinet/in_pcb.h
@@ -351,12 +351,15 @@ inp_unlock_assert(struct inpcb *inp __unused)
#endif
-void inp_apply_all(void (*func)(struct inpcb *, void *), void *arg);
-int inp_ip_tos_get(const struct inpcb *inp);
-void inp_ip_tos_set(struct inpcb *inp, int val);
-struct socket *inp_inpcbtosocket(struct inpcb *inp);
-struct tcpcb *inp_inpcbtotcpcb(struct inpcb *inp);
-void inp_4tuple_get(const struct inpcb *inp, uint32_t *laddr, uint16_t *lp, uint32_t *faddr, uint16_t *fp);
+void inp_apply_all(void (*func)(struct inpcb *, void *), void *arg);
+int inp_ip_tos_get(const struct inpcb *inp);
+void inp_ip_tos_set(struct inpcb *inp, int val);
+struct socket *
+ inp_inpcbtosocket(struct inpcb *inp);
+struct tcpcb *
+ inp_inpcbtotcpcb(struct inpcb *inp);
+void inp_4tuple_get(const struct inpcb *inp, uint32_t *laddr, uint16_t *lp,
+ uint32_t *faddr, uint16_t *fp);
#endif /* _KERNEL */
OpenPOWER on IntegriCloud