summaryrefslogtreecommitdiffstats
path: root/sys/netinet/tcp_input.c
diff options
context:
space:
mode:
authorbluhm <bluhm@openbsd.org>2016-06-27 15:59:51 +0000
committerbluhm <bluhm@openbsd.org>2016-06-27 15:59:51 +0000
commit490f401ff42f4926f0bd683dc2bae3234ac09718 (patch)
tree2e328e5beb825ff1ade2de1f1bd86b498599687b /sys/netinet/tcp_input.c
parentsomehow nopass snuck onto the :wheel example. i think it's better without. (diff)
downloadwireguard-openbsd-490f401ff42f4926f0bd683dc2bae3234ac09718.tar.xz
wireguard-openbsd-490f401ff42f4926f0bd683dc2bae3234ac09718.zip
Copy inp_hops from the listening socket to the accepted one and use
its value for the SYN+ACK packet. This makes the IPV6_UNICAST_HOPS socket option usable for incoming TCP connections. tested by renato@; OK jca@
Diffstat (limited to 'sys/netinet/tcp_input.c')
-rw-r--r--sys/netinet/tcp_input.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index 5c778028e19..688d12d412b 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_input.c,v 1.320 2016/06/27 12:25:27 bluhm Exp $ */
+/* $OpenBSD: tcp_input.c,v 1.321 2016/06/27 15:59:51 bluhm Exp $ */
/* $NetBSD: tcp_input.c,v 1.23 1996/02/13 23:43:44 christos Exp $ */
/*
@@ -3690,6 +3690,7 @@ syn_cache_get(struct sockaddr *src, struct sockaddr *dst, struct tcphdr *th,
inp->inp_flags |= (oldinp->inp_flags & INP_IPV6);
if (inp->inp_flags & INP_IPV6) {
inp->inp_ipv6.ip6_hlim = oldinp->inp_ipv6.ip6_hlim;
+ inp->inp_hops = oldinp->inp_hops;
}
#endif /* INET6 */
@@ -4346,7 +4347,7 @@ syn_cache_respond(struct syn_cache *sc, struct mbuf *m)
break;
#ifdef INET6
case AF_INET6:
- ip6->ip6_hlim = in6_selecthlim(NULL);
+ ip6->ip6_hlim = in6_selecthlim(inp);
error = ip6_output(m, NULL /*XXX*/, (struct route_in6 *)ro, 0,
NULL, NULL);