All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/1] slirp update
@ 2017-11-09 18:01 Samuel Thibault
  2017-11-09 18:01 ` [Qemu-devel] [PULL 1/1] slirp: don't zero the whole ti_i when m == NULL Samuel Thibault
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Samuel Thibault @ 2017-11-09 18:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: Samuel Thibault, stefanha, jan.kiszka

warning: redirection vers https://people.debian.org/~sthibault/qemu.git/
The following changes since commit b0fbe46ad82982b289a44ee2495b59b0bad8a842:

  Update version for v2.11.0-rc0 release (2017-11-07 16:05:28 +0000)

are available in the git repository at:

  http://people.debian.org/~sthibault/qemu.git tags/samuel-thibault

for you to fetch changes up to 990132cda9baa27bdc558df6c9c15aacb0322d2c:

  slirp: don't zero the whole ti_i when m == NULL (2017-11-09 18:59:22 +0100)

----------------------------------------------------------------
slirp updates

----------------------------------------------------------------
Tao Wu (1):
      slirp: don't zero the whole ti_i when m == NULL

This fixes the qemu slirp behavior is some rare cases (some RST cases,
keep alive probes), packets would be sent to 0.0.0.0.

 slirp/tcp_subr.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PULL 1/1] slirp: don't zero the whole ti_i when m == NULL
  2017-11-09 18:01 [Qemu-devel] [PULL 0/1] slirp update Samuel Thibault
@ 2017-11-09 18:01 ` Samuel Thibault
  2017-11-09 18:24 ` [Qemu-devel] [PULL 0/1] slirp update no-reply
  2017-11-13 14:32 ` Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Samuel Thibault @ 2017-11-09 18:01 UTC (permalink / raw)
  To: qemu-devel; +Cc: Tao Wu, stefanha, jan.kiszka, Samuel Thibault

From: Tao Wu <lepton@google.com>

98c63057d2144fb81681580cd84c13c93794c96e ('slirp: Factorizing
tcpiphdr structure with an union') introduced a memset call to clear
possibly-undefined fields in ti. This however overwrites src/dst/pr which
are used below.

So let us clear only the unused fields.

This should fix some rare cases (some RST cases, keep alive probes)
where packets would be sent to 0.0.0.0.

Signed-off-by: Tao Wu <lepton@google.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 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.14.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PULL 0/1] slirp update
  2017-11-09 18:01 [Qemu-devel] [PULL 0/1] slirp update Samuel Thibault
  2017-11-09 18:01 ` [Qemu-devel] [PULL 1/1] slirp: don't zero the whole ti_i when m == NULL Samuel Thibault
@ 2017-11-09 18:24 ` no-reply
  2017-11-13 14:32 ` Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: no-reply @ 2017-11-09 18:24 UTC (permalink / raw)
  To: samuel.thibault; +Cc: famz, qemu-devel, stefanha, jan.kiszka

Hi,

This series seems to have some coding style problems. See output below for
more information:

Subject: [Qemu-devel] [PULL 0/1] slirp update
Type: series
Message-id: 20171109180142.13923-1-samuel.thibault@ens-lyon.org

=== TEST SCRIPT BEGIN ===
#!/bin/bash

BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0

git config --local diff.renamelimit 0
git config --local diff.renames True

commits="$(git log --format=%H --reverse $BASE..)"
for c in $commits; do
    echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
    if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
        failed=1
        echo
    fi
    n=$((n+1))
done

exit $failed
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 * [new tag]               patchew/20171109180142.13923-1-samuel.thibault@ens-lyon.org -> patchew/20171109180142.13923-1-samuel.thibault@ens-lyon.org
 * [new tag]               patchew/20171109181741.31318-1-lepton@google.com -> patchew/20171109181741.31318-1-lepton@google.com
Switched to a new branch 'test'
9f23f4da08 slirp: don't zero the whole ti_i when m == NULL

=== OUTPUT BEGIN ===
Checking PATCH 1/1: slirp: don't zero the whole ti_i when m == NULL...
ERROR: code indent should never use tabs
#29: FILE: slirp/tcp_subr.c:151:
+^I^Iswitch (af) {$

ERROR: code indent should never use tabs
#30: FILE: slirp/tcp_subr.c:152:
+^I^Icase AF_INET:$

ERROR: code indent should never use tabs
#31: FILE: slirp/tcp_subr.c:153:
+^I^I    ti->ti.ti_i4.ih_x1 = 0;$

ERROR: code indent should never use tabs
#32: FILE: slirp/tcp_subr.c:154:
+^I^I    break;$

ERROR: code indent should never use tabs
#33: FILE: slirp/tcp_subr.c:155:
+^I^Icase AF_INET6:$

ERROR: code indent should never use tabs
#34: FILE: slirp/tcp_subr.c:156:
+^I^I    ti->ti.ti_i6.ih_x1 = 0;$

ERROR: code indent should never use tabs
#35: FILE: slirp/tcp_subr.c:157:
+^I^I    break;$

ERROR: code indent should never use tabs
#36: FILE: slirp/tcp_subr.c:158:
+^I^Idefault:$

ERROR: code indent should never use tabs
#37: FILE: slirp/tcp_subr.c:159:
+^I^I    g_assert_not_reached();$

ERROR: code indent should never use tabs
#38: FILE: slirp/tcp_subr.c:160:
+^I^I}$

total: 10 errors, 0 warnings, 17 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

=== OUTPUT END ===

Test command exited with code: 1


---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@freelists.org

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PULL 0/1] slirp update
  2017-11-09 18:01 [Qemu-devel] [PULL 0/1] slirp update Samuel Thibault
  2017-11-09 18:01 ` [Qemu-devel] [PULL 1/1] slirp: don't zero the whole ti_i when m == NULL Samuel Thibault
  2017-11-09 18:24 ` [Qemu-devel] [PULL 0/1] slirp update no-reply
@ 2017-11-13 14:32 ` Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2017-11-13 14:32 UTC (permalink / raw)
  To: Samuel Thibault; +Cc: QEMU Developers, Stefan Hajnoczi, Jan Kiszka

On 9 November 2017 at 18:01, Samuel Thibault
<samuel.thibault@ens-lyon.org> wrote:
> warning: redirection vers https://people.debian.org/~sthibault/qemu.git/
> The following changes since commit b0fbe46ad82982b289a44ee2495b59b0bad8a842:
>
>   Update version for v2.11.0-rc0 release (2017-11-07 16:05:28 +0000)
>
> are available in the git repository at:
>
>   http://people.debian.org/~sthibault/qemu.git tags/samuel-thibault
>
> for you to fetch changes up to 990132cda9baa27bdc558df6c9c15aacb0322d2c:
>
>   slirp: don't zero the whole ti_i when m == NULL (2017-11-09 18:59:22 +0100)
>
> ----------------------------------------------------------------
> slirp updates
>
> ----------------------------------------------------------------
> Tao Wu (1):
>       slirp: don't zero the whole ti_i when m == NULL
>
> This fixes the qemu slirp behavior is some rare cases (some RST cases,
> keep alive probes), packets would be sent to 0.0.0.0.
>
>  slirp/tcp_subr.c | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
>

Applied, thanks.

-- PMM

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-11-13 14:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-09 18:01 [Qemu-devel] [PULL 0/1] slirp update Samuel Thibault
2017-11-09 18:01 ` [Qemu-devel] [PULL 1/1] slirp: don't zero the whole ti_i when m == NULL Samuel Thibault
2017-11-09 18:24 ` [Qemu-devel] [PULL 0/1] slirp update no-reply
2017-11-13 14:32 ` Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.