[OpenAFS-devel] bug in rmtsysnet.c in 1.2.10

Jim Rees rees@umich.edu
Tue, 04 Nov 2003 11:19:08 -0500


Those cases are all the same.  Is there any reason not to combine them?  Can
someone test this?

Index: sys/rmtsysnet.c
===================================================================
RCS file: /cvs/openafs/src/sys/rmtsysnet.c,v
retrieving revision 1.7
diff -u -r1.7 rmtsysnet.c
--- sys/rmtsysnet.c	15 Jul 2003 23:16:54 -0000	1.7
+++ sys/rmtsysnet.c	4 Nov 2003 16:17:35 -0000
@@ -282,48 +282,14 @@
 	RFetchVolumeStatus_conversion(buffer, ntoh_conv);
 	break;
     case VIOCGETTOK & 0xffff:
-	lptr = (afs_int32 *) buffer;
-	if (ntoh_conv)
-	    *lptr = ntohl(*lptr);
-	else
-	    *lptr = htonl(*lptr);
-	break;
     case VIOCCKSERV & 0xffff:
-	lptr = (afs_int32 *) buffer;
-	if (ntoh_conv)
-	    *lptr = ntohl(*lptr);
-	else
-	    *lptr = htonl(*lptr);
-	break;
     case VIOCACCESS & 0xffff:
-	lptr = (afs_int32 *) buffer;
-	if (ntoh_conv)
-	    *lptr = ntohl(*lptr);
-	else
-	    *lptr = htonl(*lptr);
-	break;
     case VIOCSETCACHESIZE & 0xffff:
-	lptr = (afs_int32 *) buffer;
-	if (ntoh_conv)
-	    *lptr = ntohl(*lptr);
-	else
-	    *lptr = htonl(*lptr);
-	break;
     case VIOCGETCELL & 0xffff:
-	lptr = (afs_int32 *) buffer;
-	if (ntoh_conv)
-	    *lptr = ntohl(*lptr);
-	else
-	    *lptr = htonl(*lptr);
-	break;
     case VIOC_AFS_MARINER_HOST & 0xffff:
-	lptr = (afs_int32 *) buffer;
-	if (ntoh_conv)
-	    *lptr = ntohl(*lptr);
-	else
-	    *lptr = htonl(*lptr);
-	break;
     case VIOC_VENUSLOG & 0xffff:
+    case VIOC_AFS_SYSNAME & 0xffff:
+    case VIOC_EXPORTAFS & 0xffff:
 	lptr = (afs_int32 *) buffer;
 	if (ntoh_conv)
 	    *lptr = ntohl(*lptr);
@@ -342,20 +308,6 @@
 	else
 	    *lptr = htonl(*lptr);
 	break;
-    case VIOC_AFS_SYSNAME & 0xffff:
-	lptr = (afs_int32 *) buffer;
-	if (ntoh_conv)
-	    *lptr = ntohl(*lptr);
-	else
-	    *lptr = htonl(*lptr);
-	break;
-    case VIOC_EXPORTAFS & 0xffff:
-	lptr = (afs_int32 *) buffer;
-	if (ntoh_conv)
-	    *lptr = ntohl(*lptr);
-	else
-	    *lptr = htonl(*lptr);
-	break;
     case VIOCGETAL & 0xffff:
     case VIOCGETVOLSTAT & 0xffff:
     case VIOCGETCACHEPARMS & 0xffff:
@@ -444,39 +396,10 @@
 	lptr++;			/* primary flag */
 	break;
     case VIOCCKCONN & 0xffff:
-	if (ntoh_conv)
-	    *lptr = ntohl(*lptr);
-	else
-	    *lptr = htonl(*lptr);
-	break;
     case VIOC_AFS_MARINER_HOST & 0xffff:
-	lptr = (afs_int32 *) buffer;
-	if (ntoh_conv)
-	    *lptr = ntohl(*lptr);
-	else
-	    *lptr = htonl(*lptr);
-	break;
     case VIOC_VENUSLOG & 0xffff:
-	lptr = (afs_int32 *) buffer;
-	if (ntoh_conv)
-	    *lptr = ntohl(*lptr);
-	else
-	    *lptr = htonl(*lptr);
-	break;
     case VIOC_GETCELLSTATUS & 0xffff:
-	lptr = (afs_int32 *) buffer;
-	if (ntoh_conv)
-	    *lptr = ntohl(*lptr);
-	else
-	    *lptr = htonl(*lptr);
-	break;
     case VIOC_AFS_SYSNAME & 0xffff:
-	lptr = (afs_int32 *) buffer;
-	if (ntoh_conv)
-	    *lptr = ntohl(*lptr);
-	else
-	    *lptr = htonl(*lptr);
-	break;
     case VIOC_EXPORTAFS & 0xffff:
 	lptr = (afs_int32 *) buffer;
 	if (ntoh_conv)