aboutsummaryrefslogtreecommitdiff
path: root/slirp
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2019-03-01 18:23:41 -0800
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2019-03-06 23:36:22 +0100
commit1fd71067dae501f1c78618e9583c6cc72db0cfa6 (patch)
tree99d7c6105b161f428a48530a447e509ea8575c1b /slirp
parentd3222975c7d6cda9e25809dea05241188457b113 (diff)
slirp: fix big/little endian conversion in ident protocol
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> --- Based-on: <1551476756-25749-1-git-send-email-will@wbowling.info>
Diffstat (limited to 'slirp')
-rw-r--r--slirp/tcp_subr.c4
1 files changed, 3 insertions, 1 deletions
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);