Re: Diff Solaris 10 SPARC & x86
- From: "Daniel Rock" <v200611@xxxxxxxxxxx>
- Date: Sat, 18 Mar 2006 20:43:55 +0000 (UTC)
Mr. Chow Wing Siu <wschow@xxxxxxxxxxxxxxxx> wrote:
Andrew Gabriel <andrew@xxxxxxxxxxxxxxxxxxxx> wrote:
Most likely you have the port number in processor-native endian--------------------------------
rather than network endian (which is big-endian, same as sparc
processor native endian, but not x86). This would also be obvious
from a snoop trace. This fault would be before the code snippet
you posted.
--
Andrew Gabriel
You are absolutely correct. I use ntohs() to convert the port number
and it works fine now. Thank you.
Not that it makes any difference, but the right function would be
htons(), not ntohs():
sin.sin_port = htons(port);
remember: htons = host to network short
For htons() and nthos() it should never be a problem mixing then up, but
for htonl(), ntohl() there could in theory exist a crazy byteorder, so that
the functions produce different results.
--
Daniel
.
- References:
- Diff Solaris 10 SPARC & x86
- From: Mr. Chow Wing Siu
- Re: Diff Solaris 10 SPARC & x86
- From: Andrew Gabriel
- Re: Diff Solaris 10 SPARC & x86
- From: Mr. Chow Wing Siu
- Diff Solaris 10 SPARC & x86
- Prev by Date: Re: Does Sun offer system recovery tape?
- Next by Date: Re: compelling reasons to upgrade from Solaris 8
- Previous by thread: Re: Diff Solaris 10 SPARC & x86
- Next by thread: Interleave Factore
- Index(es):