From: Ben Kaduk Date: Sat, 3 Dec 2011 19:37:09 +0000 (-0500) Subject: FBSD: switch afsi_SetServerIPRank implementation X-Git-Tag: upstream/1.6.1.pre1^2~75 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=196895f58b086110db3f020e36fb029e14fc619b;p=packages%2Fo%2Fopenafs.git FBSD: switch afsi_SetServerIPRank implementation Upstream has removed the ia_net{,mask} elements from struct in_ifaddr, so we can no longer use them directly. Switch to passing an rx_ifaddr_t (i.e. struct ifaddr*) in instead, as that uses a slightly different codepath which still works for our purposes. We compile the kernel module with -Werror, so storing a pointer (memcpy return value) in an int is forbidden, hence the conditional declaration of 't'. Reviewed-on: http://gerrit.openafs.org/6203 Tested-by: BuildBot Reviewed-by: Derrick Brashear (cherry picked from commit 1ef8dc3dfbddcbe5610c276afc627c9fcfe30a65) Change-Id: Icb338331c879dc4cbd69ae565b115de000e8d3d0 Reviewed-on: http://gerrit.openafs.org/6235 Tested-by: BuildBot Reviewed-by: Jeffrey Altman --- diff --git a/src/afs/afs_server.c b/src/afs/afs_server.c index fa211aa61..fa99b9eca 100644 --- a/src/afs/afs_server.c +++ b/src/afs/afs_server.c @@ -1194,7 +1194,7 @@ afsi_SetServerIPRank(struct srvAddr *sa, afs_int32 addr, return; } #else /* AFS_USERSPACE_IP_ADDR */ -#if (! defined(AFS_SUN5_ENV)) && (! defined(AFS_DARWIN_ENV)) && (! defined(AFS_OBSD47_ENV)) && defined(USEIFADDR) +#if (! defined(AFS_SUN5_ENV)) && (! defined(AFS_DARWIN_ENV)) && (! defined(AFS_OBSD47_ENV)) && (! defined(AFS_FBSD_ENV)) && defined(USEIFADDR) void afsi_SetServerIPRank(struct srvAddr *sa, struct in_ifaddr *ifa) { @@ -1231,7 +1231,7 @@ afsi_SetServerIPRank(struct srvAddr *sa, struct in_ifaddr *ifa) #endif /* IFF_POINTTOPOINT */ } #endif /*(!defined(AFS_SUN5_ENV)) && defined(USEIFADDR) */ -#if (defined(AFS_DARWIN_ENV) || defined(AFS_OBSD47_ENV)) && defined(USEIFADDR) +#if (defined(AFS_DARWIN_ENV) || defined(AFS_OBSD47_ENV) || defined(AFS_FBSD_ENV)) && defined(USEIFADDR) #ifndef afs_min #define afs_min(A,B) ((A)<(B)) ? (A) : (B) #endif @@ -1240,7 +1240,11 @@ afsi_SetServerIPRank(struct srvAddr *sa, rx_ifaddr_t ifa) { struct sockaddr sout; struct sockaddr_in *sin; +#if defined(AFS_DARWIN80_ENV) && !defined(UKERNEL) int t; +#else + void *t; +#endif afs_uint32 subnetmask, myAddr, myNet, myDstaddr, mySubnet, netMask; afs_uint32 serverAddr; @@ -1564,7 +1568,7 @@ afs_SetServerPrefs(struct srvAddr *sa) #else TAILQ_FOREACH(ifa, &in_ifaddrhead, ia_link) { #endif - afsi_SetServerIPRank(sa, ifa); + afsi_SetServerIPRank(sa, &ifa->ia_ifa); }} #elif defined(AFS_OBSD_ENV) {