From: bluhm Date: Mon, 27 Jun 2016 15:59:51 +0000 (+0000) Subject: Copy inp_hops from the listening socket to the accepted one and use X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=490f401ff42f4926f0bd683dc2bae3234ac09718;p=openbsd 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@ --- 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);