From: Tao Wu <lepton@google.com>
To: qemu-devel@nongnu.org
Cc: samuel.thibault@gnu.org, Tao Wu <lepton@google.com>
Subject: [Qemu-devel] [PATCH] slirp: don't zero ti_i since we access it later.
Date: Wed, 8 Nov 2017 14:53:40 -0800 [thread overview]
Message-ID: <20171108225340.10194-1-lepton@google.com> (raw)
In-Reply-To: <20170508195404.j33kcmqncrb7fziv@var.youpi.perso.aquilenet.fr>
The current code looks buggy, we zero ti_i while we access
ti_dst/ti_src later.
Signed-off-by: Tao Wu <lepton@google.com>
---
slirp/tcp_subr.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/slirp/tcp_subr.c b/slirp/tcp_subr.c
index dc8b4bbb50..da0d53743f 100644
--- a/slirp/tcp_subr.c
+++ b/slirp/tcp_subr.c
@@ -148,7 +148,16 @@ tcp_respond(struct tcpcb *tp, struct tcpiphdr *ti, struct mbuf *m,
m->m_data += IF_MAXLINKHDR;
*mtod(m, struct tcpiphdr *) = *ti;
ti = mtod(m, struct tcpiphdr *);
- memset(&ti->ti, 0, sizeof(ti->ti));
+ switch (af) {
+ case AF_INET:
+ ti->ti.ti_i4.ih_x1 = 0;
+ break;
+ case AF_INET6:
+ ti->ti.ti_i6.ih_x1 = 0;
+ break;
+ default:
+ g_assert_not_reached();
+ }
flags = TH_ACK;
} else {
/*
--
2.15.0.448.gf294e3d99a-goog
next prev parent reply other threads:[~2017-11-08 22:53 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-20 20:43 [Qemu-devel] [PATCH 1/1] slirp: don't zero ti_i since we acccess it later Tao Wu
2017-04-24 9:15 ` Thomas Huth
2017-04-27 13:21 ` Samuel Thibault
2017-05-03 18:35 ` lepton
2017-05-04 23:05 ` Samuel Thibault
2017-05-08 19:08 ` lepton
2017-05-08 19:54 ` Samuel Thibault
2017-11-08 22:53 ` Tao Wu [this message]
2017-11-08 23:21 ` [Qemu-devel] [PATCH] slirp: don't zero ti_i since we access " no-reply
2017-11-09 10:50 ` Marc-André Lureau
2017-11-09 18:48 ` Tao Wu(吴涛@Eng)
2017-11-09 18:50 ` Samuel Thibault
2017-11-09 17:52 ` Samuel Thibault
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171108225340.10194-1-lepton@google.com \
--to=lepton@google.com \
--cc=qemu-devel@nongnu.org \
--cc=samuel.thibault@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).