]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix port problem on big-endian machines.
authorUlrich Drepper <drepper@redhat.com>
Thu, 5 Aug 1999 01:03:24 +0000 (01:03 +0000)
committerUlrich Drepper <drepper@redhat.com>
Thu, 5 Aug 1999 01:03:24 +0000 (01:03 +0000)
nis/nis_callback.c

index 6525484b4594d8606d58773a7dea5cbda4665a78..00d077959b109e1be76c140d3c91a53d3cd6efd7 100644 (file)
@@ -1,6 +1,6 @@
-/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
-   Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1997.
+   Contributed by Thorsten Kukuk <kukuk@suse.de>, 1997.
 
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public License as
@@ -349,10 +349,10 @@ __nis_create_callback (int (*callback) (const_nis_name, const nis_object *,
       syslog (LOG_ERR, "NIS+: failed to read local socket info");
       return NULL;
     }
-  port = sin.sin_port;
+  port = ntohs (sin.sin_port);
   get_myaddress (&sin);
   snprintf (addr, sizeof (addr), "%s.%d.%d", inet_ntoa (sin.sin_addr),
-           port & 0x00FF, (port & 0xFF00) >> 8);
+           (port & 0xFF00) >> 8, port & 0x00FF);
   cb->serv->ep.ep_val[0].uaddr = strdup (addr);
 
   return cb;