This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
RE: Strange getservbyname behaviour
- From: "Tuninetto, Paolo" <Paolo dot Tuninetto at hp dot com>
- To: "Andreas Schwab" <schwab at suse dot de>
- Cc: <libc-alpha at sources dot redhat dot com>
- Date: Thu, 28 Nov 2002 16:56:46 +0100
- Subject: RE: Strange getservbyname behaviour
Thanks,
my system is RH linux 7.2 (tried both on intel32 and alpha64)
Are they both Wrong Endian ;-) hosts?
Paolo
-----Original Message-----
From: Andreas Schwab [mailto:schwab@suse.de]
Sent: giovedì 28 novembre 2002 16.46
To: Tuninetto, Paolo
Cc: bug-glibc@gnu.org; libc-alpha@sources.redhat.com
Subject: Re: Strange getservbyname behaviour
"Tuninetto, Paolo" <Paolo.Tuninetto@hp.com> writes:
|> Hi, I was trying to compile the ftpd from GNU inteutils and I found that when I try to run ftpd -D (daemon mode) it opens a connection on the 5376 port instead of the default 21.
|>
|> Looking at the rource and it seems that there is a problem with the getservbyname function call that ftpd is using.
|>
|> This is a simple test program. Afaik it should reply with PORT: 21 but the reply I get is PORT: 5376 (5376 = 21*256)
Looks like you are running it on a Wrong Endian(tm) host. The port is
given in network byte order, use ntohs to convert.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."