From 0c5d24bcd2f85c2d8b80456f157c23ee756ab444 Mon Sep 17 00:00:00 2001 From: ume Date: Mon, 4 Feb 2002 17:37:06 +0000 Subject: In tcp_respond(), correctly reset returned IPv6 header. This is essential when the original packet contains an IPv6 extension header. Obtained from: KAME MFC after: 1 week --- sys/netinet/tcp_subr.c | 3 +++ sys/netinet/tcp_timewait.c | 3 +++ 2 files changed, 6 insertions(+) (limited to 'sys/netinet') diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 27d54eb..d79b816 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -427,6 +427,9 @@ tcp_respond(tp, ipgen, th, m, ack, seq, flags) } #ifdef INET6 if (isipv6) { + ip6->ip6_flow = 0; + ip6->ip6_vfc = IPV6_VERSION; + ip6->ip6_nxt = IPPROTO_TCP; ip6->ip6_plen = htons((u_short)(sizeof (struct tcphdr) + tlen)); tlen += sizeof (struct ip6_hdr) + sizeof (struct tcphdr); diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c index 27d54eb..d79b816 100644 --- a/sys/netinet/tcp_timewait.c +++ b/sys/netinet/tcp_timewait.c @@ -427,6 +427,9 @@ tcp_respond(tp, ipgen, th, m, ack, seq, flags) } #ifdef INET6 if (isipv6) { + ip6->ip6_flow = 0; + ip6->ip6_vfc = IPV6_VERSION; + ip6->ip6_nxt = IPPROTO_TCP; ip6->ip6_plen = htons((u_short)(sizeof (struct tcphdr) + tlen)); tlen += sizeof (struct ip6_hdr) + sizeof (struct tcphdr); -- cgit v1.1