From d7c79cec8295dd34fb97e6f22bfcc69dccb9f4c4 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Tue, 15 Jun 2010 12:33:48 -0500 Subject: [PATCH] afscp: Correctly advertise local addresses afscp was reporting its local address list in net-byte order, and then giving that list as a response to RXAFSCB_WhoAreYou. Instead, convert the addresses to host-byte order, since XDR takes care of endianness foo. Change-Id: I5d7d57f811ccaeada235e694ec5f343c1ac535b7 Reviewed-on: http://gerrit.openafs.org/2206 Tested-by: Andrew Deason Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/tests/afscp_callback.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/tests/afscp_callback.c b/src/tests/afscp_callback.c index e590a2657..c6a052e3d 100644 --- a/src/tests/afscp_callback.c +++ b/src/tests/afscp_callback.c @@ -15,8 +15,15 @@ init_afs_cb(void) count = rx_getAllAddr((afs_uint32 *)&afs_cb_interface.addr_in, AFS_MAX_INTERFACE_ADDR); if (count <= 0) afs_cb_interface.numberOfInterfaces = 0; - else + else { + int i; afs_cb_interface.numberOfInterfaces = count; + for (i = 0; i < count; i++) { + /* these addresss will be marshalled in XDR, so they must be in + * host-byte order to make sense */ + afs_cb_interface.addr_in[i] = ntohl(afs_cb_interface.addr_in[i]); + } + } afs_cb_inited = 1; return 0; } -- 2.39.5