summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_input.c
diff options
context:
space:
mode:
authorbluhm <bluhm@openbsd.org>2018-06-14 17:00:57 +0000
committerbluhm <bluhm@openbsd.org>2018-06-14 17:00:57 +0000
commit9cff7dcc1cec450d60ac2b538cc57e123ca3db69 (patch)
tree5d8b0561b00a86f15bca887a4f19b9372b1560ed /sys/netinet/tcp_input.c
parentMake possible to build uniprocessor WITNESS kernels without kernel_lock. (diff)
downloadwireguard-openbsd-9cff7dcc1cec450d60ac2b538cc57e123ca3db69.tar.xz
wireguard-openbsd-9cff7dcc1cec450d60ac2b538cc57e123ca3db69.zip
Assert that the INP_IPV6 in in6_pcbconnect() is correct. Just call
in_pcbconnect() to avoid the address family maze in syn_cache_get(). input claudio@; OK mpi@
Diffstat (limited to 'sys/netinet/tcp_input.c')
-rw-r--r--sys/netinet/tcp_input.c26
1 files changed, 4 insertions, 22 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index 25795a1155c..e1fdee67feb 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_input.c,v 1.356 2018/06/11 07:40:26 bluhm Exp $ */
+/* $OpenBSD: tcp_input.c,v 1.357 2018/06/14 17:00:57 bluhm Exp $ */
/* $NetBSD: tcp_input.c,v 1.23 1996/02/13 23:43:44 christos Exp $ */
/*
@@ -3537,27 +3537,9 @@ syn_cache_get(struct sockaddr *src, struct sockaddr *dst, struct tcphdr *th,
goto resetandabort;
am->m_len = src->sa_len;
memcpy(mtod(am, caddr_t), src, src->sa_len);
-
- switch (src->sa_family) {
- case AF_INET:
- /* drop IPv4 packet to AF_INET6 socket */
- if (inp->inp_flags & INP_IPV6) {
- (void) m_free(am);
- goto resetandabort;
- }
- if (in_pcbconnect(inp, am)) {
- (void) m_free(am);
- goto resetandabort;
- }
- break;
-#ifdef INET6
- case AF_INET6:
- if (in6_pcbconnect(inp, am)) {
- (void) m_free(am);
- goto resetandabort;
- }
- break;
-#endif
+ if (in_pcbconnect(inp, am)) {
+ (void) m_free(am);
+ goto resetandabort;
}
(void) m_free(am);