blob: c5884b883c13ec1c431a8948980e771753db7f1d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
https://bugs.gentoo.org/18892
patch by Michael Hanselmann <hansmi@gentoo.org>
--- a/tcpserver.c
+++ b/tcpserver.c
@@ -422,7 +422,11 @@
se = getservbyname(x,"tcp");
if (!se)
strerr_die3x(111,FATAL,"unable to figure out port number for ",x);
+#if __BYTE_ORDER == __BIG_ENDIAN || BYTE_ORDER == BIG_ENDIAN
+ localport = ntohs(se->s_port);
+#else
uint16_unpack_big((char*)&se->s_port,&localport);
+#endif
}
if (!*argv) usage();
|