From: Andrew Deason Date: Fri, 25 Jun 2010 19:17:49 +0000 (-0500) Subject: Use unsigned addresses in the NFS exporter X-Git-Tag: openafs-devel-1_5_75~62 X-Git-Url: https://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=7d1bbee02a80f045a6ae4e30410798f4785906a8 Use unsigned addresses in the NFS exporter Use unsigned IP addresses in the NFS exporter code in libafs. This modifies the distributed headers exporter.h and nfsclient.h. Change-Id: Ieaddf21e487ae416d7b003223566c999c64279aa Reviewed-on: http://gerrit.openafs.org/2256 Tested-by: Andrew Deason Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- diff --git a/src/afs/afs_nfsclnt.c b/src/afs/afs_nfsclnt.c index 6e4f52c..3abc982 100644 --- a/src/afs/afs_nfsclnt.c +++ b/src/afs/afs_nfsclnt.c @@ -22,7 +22,7 @@ void afs_nfsclient_hold(), afs_PutNfsClientPag(), afs_nfsclient_GC(); static void afs_nfsclient_getcreds(); int afs_nfsclient_sysname(), afs_nfsclient_stats(), afs_nfsclient_checkhost(); -afs_int32 afs_nfsclient_gethost(); +afs_uint32 afs_nfsclient_gethost(); #ifdef AFS_AIX_IAUTH_ENV int afs_allnfsreqs, afs_nfscalls; #endif @@ -47,7 +47,7 @@ extern struct afs_exporter *afs_nfsexporter; /* Creates an nfsclientpag structure for the (uid, host) pair if one doesn't * exist. RefCount is incremented and it's time stamped. */ static struct nfsclientpag * -afs_GetNfsClientPag(register afs_int32 uid, register afs_int32 host) +afs_GetNfsClientPag(register afs_int32 uid, register afs_uint32 host) { register struct nfsclientpag *np; register afs_int32 i, now; @@ -109,7 +109,7 @@ afs_PutNfsClientPag(np) * {pag, host} pair, if pag is nonzero. RefCount is incremented and it's * time stamped. */ static struct nfsclientpag * -afs_FindNfsClientPag(afs_int32 uid, afs_int32 host, afs_int32 pag) +afs_FindNfsClientPag(afs_int32 uid, afs_uint32 host, afs_int32 pag) { register struct nfsclientpag *np; register afs_int32 i; @@ -175,7 +175,7 @@ afs_nfsclient_init(void) int afs_nfsclient_reqhandler(struct afs_exporter *exporter, afs_ucred_t **cred, - afs_int32 host, afs_int32 *pagparam, + afs_uint32 host, afs_int32 *pagparam, struct afs_exporter **outexporter) { register struct nfsclientpag *np, *tnp; @@ -429,7 +429,7 @@ afs_nfsclient_hold(register struct nfsclientpag *np) /* check if this exporter corresponds to the specified host */ int -afs_nfsclient_checkhost(register struct nfsclientpag *np, int host) +afs_nfsclient_checkhost(register struct nfsclientpag *np, afs_uint32 host) { if (np->type != EXP_NFS) return 0; @@ -438,7 +438,7 @@ afs_nfsclient_checkhost(register struct nfsclientpag *np, int host) /* get the host for this exporter, or 0 if there is an error */ -afs_int32 +afs_uint32 afs_nfsclient_gethost(register struct nfsclientpag *np) { if (np->type != EXP_NFS) diff --git a/src/afs/afs_prototypes.h b/src/afs/afs_prototypes.h index 221dcd2..362bed1 100644 --- a/src/afs/afs_prototypes.h +++ b/src/afs/afs_prototypes.h @@ -523,7 +523,7 @@ extern struct afs_exporter *afs_nfsexporter; extern void afs_nfsclient_init(void); extern int afs_nfsclient_reqhandler(struct afs_exporter *exporter, afs_ucred_t **cred, - afs_int32 host, afs_int32 *pagparam, + afs_uint32 host, afs_int32 *pagparam, struct afs_exporter **outexporter); extern void shutdown_nfsclnt(void); diff --git a/src/afs/exporter.h b/src/afs/exporter.h index 0e3ffe2..83dba5c 100644 --- a/src/afs/exporter.h +++ b/src/afs/exporter.h @@ -64,8 +64,8 @@ struct exporterops { void (*export_garbagecollect) (struct afs_exporter *exp, afs_int32 param); int (*export_statistics) (struct afs_exporter *exp); - int (*export_checkhost) (struct afs_exporter *exp, afs_int32 host); - afs_int32 (*export_gethost) (struct afs_exporter *exp); + int (*export_checkhost) (struct afs_exporter *exp, afs_uint32 host); + afs_uint32 (*export_gethost) (struct afs_exporter *exp); }; struct exporterstats { diff --git a/src/afs/nfsclient.h b/src/afs/nfsclient.h index fa96f0b..7568a3a 100644 --- a/src/afs/nfsclient.h +++ b/src/afs/nfsclient.h @@ -26,7 +26,7 @@ struct nfsclientpag { afs_int32 refCount; /* Ref count for packages using this */ afs_int32 uid; /* search based on uid and ... */ - afs_int32 host; /* ... nfs client's host ip address */ + afs_uint32 host; /* ... nfs client's host ip address */ afs_int32 pag; /* active pag for all (uid, host) "unpaged" conns */ afs_int32 client_uid; /* actual UID on client */ char *sysname[MAXNUMSYSNAMES];/* user's "@sys" value; also kept in unixuser */