summaryrefslogtreecommitdiff
path: root/sys/netinet/tcp_input.c
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2018-06-14 17:00:59 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2018-06-14 17:00:59 +0000
commit27a5008cc2bc7e86b58eda8d6a8e0f59e8272a32 (patch)
treed58816d9f754ecc785935791a6bca5a40671d4a6 /sys/netinet/tcp_input.c
parentd4abb587047c245f1df252f7555212e191e790c4 (diff)
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);