Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F152837159
D55560.id172856.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D55560.id172856.diff
View Options
diff --git a/sys/net/vnet.c b/sys/net/vnet.c
--- a/sys/net/vnet.c
+++ b/sys/net/vnet.c
@@ -172,10 +172,16 @@
#define VNET_SIZE roundup2(VNET_BYTES, PAGE_SIZE)
/*
+ * Ensure space allocated by vnet_data_alloc() is suitably aligned for any
+ * object.
+ */
+#define VNET_DATAALIGN _Alignof(__max_align_t)
+
+/*
* Space to store virtualized global variables from loadable kernel modules,
* and the free list to manage it.
*/
-VNET_DEFINE_STATIC(char, modspace[VNET_MODMIN] __aligned(__alignof(void *)));
+VNET_DEFINE_STATIC(char, modspace[VNET_MODMIN] __aligned(VNET_DATAALIGN));
/*
* A copy of the initial values of all virtualized global variables.
@@ -385,7 +391,7 @@
void *s;
s = NULL;
- size = roundup2(size, sizeof(void *));
+ size = roundup2(size, VNET_DATAALIGN);
sx_xlock(&vnet_data_free_lock);
TAILQ_FOREACH(df, &vnet_data_free_head, vnd_link) {
if (df->vnd_len < size)
@@ -417,7 +423,7 @@
uintptr_t start;
uintptr_t end;
- size = roundup2(size, sizeof(void *));
+ size = roundup2(size, VNET_DATAALIGN);
start = (uintptr_t)start_arg;
end = start + size;
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Apr 18, 10:30 AM (8 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29067751
Default Alt Text
D55560.id172856.diff (1 KB)
Attached To
Mode
D55560: vnet: Ensure space allocated by vnet_data_alloc() is properly aligned
Attached
Detach File
Event Timeline
Log In to Comment