summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_input.c
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2009-06-05 00:05:21 +0000
committerclaudio <claudio@openbsd.org>2009-06-05 00:05:21 +0000
commit22760f565a521eee1242a6b1041c186acc77d298 (patch)
treecf09757382c6a5172e7749b5e2348595c70d6bc3 /sys/netinet/tcp_input.c
parentMake imsg completely async model agnostic by not requiring an (diff)
downloadwireguard-openbsd-22760f565a521eee1242a6b1041c186acc77d298.tar.xz
wireguard-openbsd-22760f565a521eee1242a6b1041c186acc77d298.zip
Initial support for routing domains. This allows to bind interfaces to
alternate routing table and separate them from other interfaces in distinct routing tables. The same network can now be used in any doamin at the same time without causing conflicts. This diff is mostly mechanical and adds the necessary rdomain checks accross net and netinet. L2 and IPv4 are mostly covered still missing pf and IPv6. input and tested by jsg@, phessler@ and reyk@. "put it in" deraadt@
Diffstat (limited to 'sys/netinet/tcp_input.c')
-rw-r--r--sys/netinet/tcp_input.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index aee2240007e..c8912fccf68 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_input.c,v 1.225 2009/06/03 18:22:44 naddy Exp $ */
+/* $OpenBSD: tcp_input.c,v 1.226 2009/06/05 00:05:22 claudio Exp $ */
/* $NetBSD: tcp_input.c,v 1.23 1996/02/13 23:43:44 christos Exp $ */
/*
@@ -605,7 +605,8 @@ findpcb:
#endif
case AF_INET:
inp = in_pcbhashlookup(&tcbtable, ip->ip_src,
- th->th_sport, ip->ip_dst, th->th_dport);
+ th->th_sport, ip->ip_dst, th->th_dport,
+ m->m_pkthdr.rdomain);
break;
}
#if NPF > 0
@@ -630,7 +631,8 @@ findpcb:
#endif /* INET6 */
case AF_INET:
inp = in_pcblookup_listen(&tcbtable,
- ip->ip_dst, th->th_dport, inpl_flags, m);
+ ip->ip_dst, th->th_dport, inpl_flags, m,
+ m->m_pkthdr.rdomain);
break;
}
/*
@@ -3033,7 +3035,7 @@ tcp_mss(struct tcpcb *tp, int offer)
else if (tp->pf == AF_INET) {
if (ip_mtudisc)
mss = ifp->if_mtu - iphlen - sizeof(struct tcphdr);
- else if (inp && in_localaddr(inp->inp_faddr))
+ else if (inp && in_localaddr(inp->inp_faddr, inp->inp_rdomain))
mss = ifp->if_mtu - iphlen - sizeof(struct tcphdr);
}
#ifdef INET6