summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2006-12-05 12:04:37 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2006-12-05 12:04:37 +0000
commit3de6f5cc98111b3a72ee14ad2e00afaafd0a8d83 (patch)
tree845d05074dacfe8d0d0dddc7a6429047ac4b1089
parentd55fe3c65b7750ddae207840ca7f429005cad497 (diff)
make the syncache code respect (inherit) the ttl from the listening socket
when sending the synack response. ok markus
-rw-r--r--sys/netinet/tcp_input.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index 9a3c5f652d3..19534c3ab54 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcp_input.c,v 1.198 2006/10/31 16:22:25 markus Exp $ */
+/* $OpenBSD: tcp_input.c,v 1.199 2006/12/05 12:04:36 henning Exp $ */
/* $NetBSD: tcp_input.c,v 1.23 1996/02/13 23:43:44 christos Exp $ */
/*
@@ -4328,6 +4328,9 @@ syn_cache_respond(sc, m)
#endif
}
+ /* use IPsec policy and ttl from listening socket, on SYN ACK */
+ inp = sc->sc_tp ? sc->sc_tp->t_inpcb : NULL;
+
/*
* Fill in some straggling IP bits. Note the stack expects
* ip_len to be in host order, for convenience.
@@ -4336,7 +4339,7 @@ syn_cache_respond(sc, m)
#ifdef INET
case AF_INET:
ip->ip_len = htons(tlen);
- ip->ip_ttl = ip_defttl;
+ ip->ip_ttl = inp ? inp->inp_ip.ip_ttl : ip_defttl;
/* XXX tos? */
break;
#endif
@@ -4351,9 +4354,6 @@ syn_cache_respond(sc, m)
#endif
}
- /* use IPsec policy from listening socket, on SYN ACK */
- inp = sc->sc_tp ? sc->sc_tp->t_inpcb : NULL;
-
switch (sc->sc_src.sa.sa_family) {
#ifdef INET
case AF_INET: