yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
Pablo Greco e6a3ae
From f4157e1c90e8986d95a57bf00cc8c0e297869c35 Mon Sep 17 00:00:00 2001
Pablo Greco e6a3ae
From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= <philmd@redhat.com>
Pablo Greco e6a3ae
Date: Wed, 24 Jul 2019 15:53:35 +0100
Pablo Greco e6a3ae
Subject: [PATCH 10/14] slirp: fix big/little endian conversion in ident
Pablo Greco e6a3ae
 protocol
Pablo Greco e6a3ae
MIME-Version: 1.0
Pablo Greco e6a3ae
Content-Type: text/plain; charset=UTF-8
Pablo Greco e6a3ae
Content-Transfer-Encoding: 8bit
Pablo Greco e6a3ae
Pablo Greco e6a3ae
RH-Author: Philippe Mathieu-Daudé <philmd@redhat.com>
Pablo Greco e6a3ae
Message-id: <20190724155337.25303-3-philmd@redhat.com>
Pablo Greco e6a3ae
Patchwork-id: 89674
Pablo Greco e6a3ae
O-Subject: [RHEL-8.1.0 qemu-kvm PATCH v2 2/4] slirp: fix big/little endian conversion in ident protocol
Pablo Greco e6a3ae
Bugzilla: 1727642
Pablo Greco e6a3ae
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
Pablo Greco e6a3ae
RH-Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Pablo Greco e6a3ae
RH-Acked-by: Thomas Huth <thuth@redhat.com>
Pablo Greco e6a3ae
Pablo Greco e6a3ae
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
Pablo Greco e6a3ae
Pablo Greco e6a3ae
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Pablo Greco e6a3ae
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Pablo Greco e6a3ae
(cherry picked from commit 1fd71067dae501f1c78618e9583c6cc72db0cfa6)
Pablo Greco e6a3ae
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Pablo Greco e6a3ae
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
Pablo Greco e6a3ae
---
Pablo Greco e6a3ae
 slirp/tcp_subr.c | 4 +++-
Pablo Greco e6a3ae
 1 file changed, 3 insertions(+), 1 deletion(-)
Pablo Greco e6a3ae
Pablo Greco e6a3ae
diff --git a/slirp/tcp_subr.c b/slirp/tcp_subr.c
Pablo Greco e6a3ae
index af1b3eb..393447d 100644
Pablo Greco e6a3ae
--- a/slirp/tcp_subr.c
Pablo Greco e6a3ae
+++ b/slirp/tcp_subr.c
Pablo Greco e6a3ae
@@ -661,10 +661,12 @@ tcp_emu(struct socket *so, struct mbuf *m)
Pablo Greco e6a3ae
 						    tmpso->so_fport == n1) {
Pablo Greco e6a3ae
 							if (getsockname(tmpso->s,
Pablo Greco e6a3ae
 								(struct sockaddr *)&addr, &addrlen) == 0)
Pablo Greco e6a3ae
-							   n2 = ntohs(addr.sin_port);
Pablo Greco e6a3ae
+							   n2 = addr.sin_port;
Pablo Greco e6a3ae
 							break;
Pablo Greco e6a3ae
 						}
Pablo Greco e6a3ae
 					}
Pablo Greco e6a3ae
+					NTOHS(n1);
Pablo Greco e6a3ae
+					NTOHS(n2);
Pablo Greco e6a3ae
 					so_rcv->sb_cc = snprintf(so_rcv->sb_data,
Pablo Greco e6a3ae
 								 so_rcv->sb_datalen,
Pablo Greco e6a3ae
 								 "%d,%d\r\n", n1, n2);
Pablo Greco e6a3ae
-- 
Pablo Greco e6a3ae
1.8.3.1
Pablo Greco e6a3ae