diff options
author | 2008-02-20 11:24:02 +0000 | |
---|---|---|
committer | 2008-02-20 11:24:02 +0000 | |
commit | caf24af4e18c322236295bc775c79e6103902305 (patch) | |
tree | f386b85f961b94fa15c4b0260f26c3d6c8327480 /sys/netinet/tcp_input.c | |
parent | when bge has link, use autopolling for link status, not direct mii polls. (diff) | |
download | wireguard-openbsd-caf24af4e18c322236295bc775c79e6103902305.tar.xz wireguard-openbsd-caf24af4e18c322236295bc775c79e6103902305.zip |
when creating a response, use the correct TCP header instead of
relying on the mbuf chain layout; with claudio@ and krw@; ok henning@
Diffstat (limited to 'sys/netinet/tcp_input.c')
-rw-r--r-- | sys/netinet/tcp_input.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index a5b0b39b2b0..ebbff633605 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcp_input.c,v 1.211 2008/02/11 18:03:16 bluhm Exp $ */ +/* $OpenBSD: tcp_input.c,v 1.212 2008/02/20 11:24:02 markus Exp $ */ /* $NetBSD: tcp_input.c,v 1.23 1996/02/13 23:43:44 christos Exp $ */ /* @@ -2209,14 +2209,15 @@ dropwithreset: if (tiflags & TH_RST) goto drop; if (tiflags & TH_ACK) { - tcp_respond(tp, mtod(m, caddr_t), m, (tcp_seq)0, th->th_ack, + tcp_respond(tp, mtod(m, caddr_t), th, (tcp_seq)0, th->th_ack, TH_RST); } else { if (tiflags & TH_SYN) tlen++; - tcp_respond(tp, mtod(m, caddr_t), m, th->th_seq + tlen, + tcp_respond(tp, mtod(m, caddr_t), th, th->th_seq + tlen, (tcp_seq)0, TH_RST|TH_ACK); } + m_freem(m); return; drop: @@ -3863,7 +3864,8 @@ syn_cache_get(src, dst, th, hlen, tlen, so, m) return (so); resetandabort: - tcp_respond(NULL, mtod(m, caddr_t), m, (tcp_seq)0, th->th_ack, TH_RST); + tcp_respond(NULL, mtod(m, caddr_t), th, (tcp_seq)0, th->th_ack, TH_RST); + m_freem(m); abort: if (so != NULL) (void) soabort(so); |