thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone

Blame SOURCES/kvm-slirp-fix-big-little-endian-conversion-in-ident-prot.patch

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