summaryrefslogtreecommitdiff
path: root/methods/rfc2553emu.cc
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:56:08 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:56:08 +0000
commit82e0333ea55e90468bf7531dcd8dcb74057ac459 (patch)
tree15a5d6a47c1544f6e1f79d5c7ba109ddcefe4caa /methods/rfc2553emu.cc
parent9b148dad600b3fe76d38e612c1865f85bbab254f (diff)
Bug fixes to rfc2553 emulation
Author: jgg Date: 2000-06-18 06:04:45 GMT Bug fixes to rfc2553 emulation
Diffstat (limited to 'methods/rfc2553emu.cc')
-rw-r--r--methods/rfc2553emu.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/methods/rfc2553emu.cc b/methods/rfc2553emu.cc
index 05d9f0c32..22daa2231 100644
--- a/methods/rfc2553emu.cc
+++ b/methods/rfc2553emu.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: rfc2553emu.cc,v 1.6 1999/12/11 02:11:10 jgg Exp $
+// $Id: rfc2553emu.cc,v 1.7 2000/06/18 06:04:45 jgg Exp $
/* ######################################################################
RFC 2553 Emulation - Provides emulation for RFC 2553 getaddrinfo,
@@ -202,9 +202,9 @@ int getnameinfo(const struct sockaddr *sa, socklen_t salen,
{
struct servent *Ent;
if ((flags & NI_DATAGRAM) == NI_DATAGRAM)
- Ent = getservbyport(sin->sin_port,"udp");
+ Ent = getservbyport(ntohs(sin->sin_port),"udp");
else
- Ent = getservbyport(sin->sin_port,"tcp");
+ Ent = getservbyport(ntohs(sin->sin_port),"tcp");
if (Ent != 0)
strncpy(serv,Ent->s_name,servlen);
@@ -220,7 +220,7 @@ int getnameinfo(const struct sockaddr *sa, socklen_t salen,
// Resolve as a plain numberic
if ((flags & NI_NUMERICSERV) == NI_NUMERICSERV)
{
- snprintf(serv,servlen,"%u",sin->sin_port);
+ snprintf(serv,servlen,"%u",ntohs(sin->sin_port));
}
}