From c4f0da0d56afe3f496315a052b40086d8a94789f Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 5 Aug 1999 01:03:24 +0000 Subject: [PATCH] Fix port problem on big-endian machines. --- nis/nis_callback.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nis/nis_callback.c b/nis/nis_callback.c index 6525484b459..00d077959b1 100644 --- a/nis/nis_callback.c +++ b/nis/nis_callback.c @@ -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 , 1997. + Contributed by Thorsten Kukuk , 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; -- 2.47.3