git: 25682e6a495f - main - Fix rtsock sockaddr alignment.
Alexander V. Chernikov
melifaro at FreeBSD.org
Tue Apr 27 08:33:08 UTC 2021
The branch main has been updated by melifaro:
URL: https://cgit.FreeBSD.org/src/commit/?id=25682e6a495fc6669d799bb64acdaf14d653173e
commit 25682e6a495fc6669d799bb64acdaf14d653173e
Author: Alexander V. Chernikov <melifaro at FreeBSD.org>
AuthorDate: 2021-04-27 08:04:19 +0000
Commit: Alexander V. Chernikov <melifaro at FreeBSD.org>
CommitDate: 2021-04-27 08:04:19 +0000
Fix rtsock sockaddr alignment.
b31fbebeb3 introduced alloc_sockaddr_aligned() which, in fact,
failed to produce aligned addresses.
Reported by: Oskar Holmlund <oskar.holmlund at yahoo.com>
MFC after: immediately
---
sys/net/rtsock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c
index fae15fdf4be6..6930bd167ac1 100644
--- a/sys/net/rtsock.c
+++ b/sys/net/rtsock.c
@@ -1009,7 +1009,7 @@ save_add_notification(struct rib_cmd_info *rc, void *_cbdata)
static struct sockaddr *
alloc_sockaddr_aligned(struct linear_buffer *lb, int len)
{
- len |= (sizeof(uint64_t) - 1);
+ len = roundup2(len, sizeof(uint64_t));
if (lb->offset + len > lb->size)
return (NULL);
struct sockaddr *sa = (struct sockaddr *)(lb->base + lb->offset);
More information about the dev-commits-src-main
mailing list