From patchwork Sat Mar 2 02:25:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 10836311 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E73BD17E9 for ; Sat, 2 Mar 2019 02:27:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D5A012DA96 for ; Sat, 2 Mar 2019 02:27:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C89932DB1C; Sat, 2 Mar 2019 02:27:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4BC902DA96 for ; Sat, 2 Mar 2019 02:27:05 +0000 (UTC) Received: from localhost ([127.0.0.1]:47257 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzuMi-0001Nh-GT for patchwork-qemu-devel@patchwork.kernel.org; Fri, 01 Mar 2019 21:27:04 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53008) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzuLQ-0000Qt-U3 for qemu-devel@nongnu.org; Fri, 01 Mar 2019 21:25:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gzuLN-0003w7-61 for qemu-devel@nongnu.org; Fri, 01 Mar 2019 21:25:42 -0500 Received: from hera.aquilenet.fr ([2a0c:e300::1]:47188) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gzuLH-0003eC-C7 for qemu-devel@nongnu.org; Fri, 01 Mar 2019 21:25:37 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id C0954465F; Sat, 2 Mar 2019 03:25:26 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QP3GYqgoDr2D; Sat, 2 Mar 2019 03:25:26 +0100 (CET) Received: from function (c-73-221-37-96.hsd1.wa.comcast.net [73.221.37.96]) by hera.aquilenet.fr (Postfix) with ESMTPSA id CC5B018CC; Sat, 2 Mar 2019 03:25:25 +0100 (CET) Received: from samy by function with local (Exim 4.92-RC6) (envelope-from ) id 1gzuL0-0004se-Tv; Sat, 02 Mar 2019 03:25:18 +0100 From: Samuel Thibault To: qemu-devel@nongnu.org Date: Fri, 1 Mar 2019 18:25:18 -0800 Message-Id: <20190302022518.18719-1-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a0c:e300::1 Subject: [Qemu-devel] [PATCH] slirp: fix big/little endian conversion in ident protocol X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Samuel Thibault , will@wbowling.info, stefanha@redhat.com, jan.kiszka@siemens.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Samuel Thibault Reviewed-by: Philippe Mathieu-Daudé --- slirp/tcp_subr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/slirp/tcp_subr.c b/slirp/tcp_subr.c index ef9d99c154..1d7e72dca7 100644 --- a/slirp/tcp_subr.c +++ b/slirp/tcp_subr.c @@ -660,10 +660,12 @@ tcp_emu(struct socket *so, struct mbuf *m) tmpso->so_fport == n1) { if (getsockname(tmpso->s, (struct sockaddr *)&addr, &addrlen) == 0) - n2 = ntohs(addr.sin_port); + n2 = addr.sin_port; break; } } + NTOHS(n1); + NTOHS(n2); so_rcv->sb_cc = snprintf(so_rcv->sb_data, so_rcv->sb_datalen, "%d,%d\r\n", n1, n2);