summaryrefslogtreecommitdiff
path: root/sys/netinet/in_pcb.c
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2008-05-15 19:40:39 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2008-05-15 19:40:39 +0000
commitde28a5488d238ee5f0b97a2d204f218adeb88e8e (patch)
tree61b5440c53aaa5d75c8892be09c31d8dfce9c3da /sys/netinet/in_pcb.c
parentd35a433ba50c5edc5ee1e5f646428209ec1e7800 (diff)
divert for ipv6; ok henning, pyr
Diffstat (limited to 'sys/netinet/in_pcb.c')
-rw-r--r--sys/netinet/in_pcb.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c
index 599c712c690..ad69036f1c5 100644
--- a/sys/netinet/in_pcb.c
+++ b/sys/netinet/in_pcb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: in_pcb.c,v 1.97 2008/05/09 03:14:07 markus Exp $ */
+/* $OpenBSD: in_pcb.c,v 1.98 2008/05/15 19:40:38 markus Exp $ */
/* $NetBSD: in_pcb.c,v 1.25 1996/02/13 23:41:53 christos Exp $ */
/*
@@ -1083,17 +1083,24 @@ in_pcblookup_listen(struct inpcbtable *table, struct in_addr laddr,
#ifdef INET6
struct inpcb *
-in6_pcblookup_listen(table, laddr, lport_arg, reverse)
- struct inpcbtable *table;
- struct in6_addr *laddr;
- u_int lport_arg;
- int reverse;
+in6_pcblookup_listen(struct inpcbtable *table, struct in6_addr *laddr,
+ u_int lport_arg, int reverse, struct mbuf *m)
{
struct inpcbhead *head;
struct in6_addr *key1, *key2;
struct inpcb *inp;
u_int16_t lport = lport_arg;
+#if NPF
+ if (m && m->m_pkthdr.pf.flags & PF_TAG_DIVERTED) {
+ struct pf_divert *divert;
+
+ if ((divert = pf_find_divert(m)) == NULL)
+ return (NULL);
+ key1 = key2 = &divert->addr.ipv6;
+ lport = divert->port;
+ } else
+#endif
if (reverse) {
key1 = &zeroin6_addr;
key2 = laddr;