From: Derrick Brashear Date: Thu, 12 May 2011 14:59:53 +0000 (-0400) Subject: afscp: tellmeaboutyourself stub wants host byte order X-Git-Tag: upstream/1.6.1.pre1^2~240 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=8e3cb5ddcab7d3c6cfc274851da3e9835e1e9d0b;p=packages%2Fo%2Fopenafs.git afscp: tellmeaboutyourself stub wants host byte order we get network byte order addresses from rx_getAllAddr; swap back to host order. Reviewed-on: http://gerrit.openafs.org/4644 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear (cherry picked from commit e4dc78845cec721013be4170231936ef371afe2f) Change-Id: I9c80d61fc73af936cc87c87033a121cf4593a4c9 Reviewed-on: http://gerrit.openafs.org/5387 Tested-by: BuildBot Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- diff --git a/src/libafscp/afscp_callback.c b/src/libafscp/afscp_callback.c index 32db5fb95..8a0403f89 100644 --- a/src/libafscp/afscp_callback.c +++ b/src/libafscp/afscp_callback.c @@ -52,6 +52,7 @@ static int init_afs_cb(void) { int cm_noIPAddr; /* number of client network interfaces */ + int i; #ifdef AFS_NT40_ENV /* * This Windows section was pulled in from changes to src/venus/afsio.c but is @@ -64,7 +65,6 @@ init_afs_cb(void) int cm_SubnetMask[CM_MAXINTERFACE_ADDR]; /* client's subnet mask in host order */ int cm_NetMtu[CM_MAXINTERFACE_ADDR]; /* client's MTU sizes */ int cm_NetFlags[CM_MAXINTERFACE_ADDR]; /* network flags */ - int i; UuidCreate((UUID *) & afs_cb_interface.uuid); cm_noIPAddr = CM_MAXINTERFACE_ADDR; @@ -91,8 +91,12 @@ init_afs_cb(void) AFS_MAX_INTERFACE_ADDR); if (cm_noIPAddr < 0) afs_cb_interface.numberOfInterfaces = 0; - else + else { afs_cb_interface.numberOfInterfaces = cm_noIPAddr; + /* we expect these in host byte order */ + for (i = 0; i < cm_noIPAddr; i++) + afs_cb_interface.addr_in[i] = ntohl(afs_cb_interface.addr_in[i]); + } #endif afs_cb_inited = 1; return 0;