svn commit: r364846 - head/sys/opencrypto

John Baldwin jhb at FreeBSD.org
Wed Aug 26 22:36:09 UTC 2020


Author: jhb
Date: Wed Aug 26 22:36:08 2020
New Revision: 364846
URL: https://svnweb.freebsd.org/changeset/base/364846

Log:
  Name the on-stack union of compat thunks.
  
  C does not permit an anonymous union at a top-level scope.
  
  Pointy hat to:	jhb

Modified:
  head/sys/opencrypto/cryptodev.c

Modified: head/sys/opencrypto/cryptodev.c
==============================================================================
--- head/sys/opencrypto/cryptodev.c	Wed Aug 26 22:11:22 2020	(r364845)
+++ head/sys/opencrypto/cryptodev.c	Wed Aug 26 22:36:08 2020	(r364846)
@@ -440,7 +440,7 @@ cryptof_ioctl(
 		struct crypt_aead aeadc;
 		struct crypt_kop kopc;
 #endif
-	};
+	} thunk;
 #ifdef COMPAT_FREEBSD32
 	u_long cmd32;
 	void *data32;
@@ -452,29 +452,30 @@ cryptof_ioctl(
 		cmd32 = cmd;
 		data32 = data;
 		cmd = CIOCGSESSION;
-		data = &sopc;
-		session_op_from_32((struct session_op32 *)data32, &sopc);
+		data = &thunk.sopc;
+		session_op_from_32((struct session_op32 *)data32, &thunk.sopc);
 		break;
 	case CIOCGSESSION232:
 		cmd32 = cmd;
 		data32 = data;
 		cmd = CIOCGSESSION2;
-		data = &sopc;
-		session2_op_from_32((struct session2_op32 *)data32, &sopc);
+		data = &thunk.sopc;
+		session2_op_from_32((struct session2_op32 *)data32,
+		    &thunk.sopc);
 		break;
 	case CIOCCRYPT32:
 		cmd32 = cmd;
 		data32 = data;
 		cmd = CIOCCRYPT;
-		data = &copc;
-		crypt_op_from_32((struct crypt_op32 *)data32, &copc);
+		data = &thunk.copc;
+		crypt_op_from_32((struct crypt_op32 *)data32, &thunk.copc);
 		break;
 	case CIOCCRYPTAEAD32:
 		cmd32 = cmd;
 		data32 = data;
 		cmd = CIOCCRYPTAEAD;
-		data = &aeadc;
-		crypt_aead_from_32((struct crypt_aead32 *)data32, &aeadc);
+		data = &thunk.aeadc;
+		crypt_aead_from_32((struct crypt_aead32 *)data32, &thunk.aeadc);
 		break;
 	case CIOCKEY32:
 	case CIOCKEY232:
@@ -484,8 +485,8 @@ cryptof_ioctl(
 			cmd = CIOCKEY;
 		else
 			cmd = CIOCKEY2;
-		data = &kopc;
-		crypt_kop_from_32((struct crypt_kop32 *)data32, &kopc);
+		data = &thunk.kopc;
+		crypt_kop_from_32((struct crypt_kop32 *)data32, &thunk.kopc);
 		break;
 	}
 #endif
@@ -494,8 +495,8 @@ cryptof_ioctl(
 	case CIOCGSESSION:
 	case CIOCGSESSION2:
 		if (cmd == CIOCGSESSION) {
-			session2_op_from_op(data, &sopc);
-			sop = &sopc;
+			session2_op_from_op(data, &thunk.sopc);
+			sop = &thunk.sopc;
 		} else
 			sop = (struct session2_op *)data;
 


More information about the svn-src-head mailing list