diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2016-06-27 15:59:52 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2016-06-27 15:59:52 +0000 |
commit | 9516394ee28d7f96d466feee1b96506e8714100e (patch) | |
tree | 1e23fabf7187c8ec11e2f0c7b2804a461c9f8667 | |
parent | 2f836cd4b4f555059beb70dcbc1751d9e8442817 (diff) |
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@
-rw-r--r-- | sys/netinet/tcp_input.c | 5 |
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); |