aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander V. Chernikov <melifaro@FreeBSD.org>2021-04-27 08:04:19 +0000
committerAlexander V. Chernikov <melifaro@FreeBSD.org>2021-04-27 08:04:19 +0000
commit25682e6a495fc6669d799bb64acdaf14d653173e (patch)
tree9dddcbc27b762aa339321bf64a721d2a21440529
parentbc5ef45aec3fa8acf2dd3408cebd207317543a8b (diff)
downloadsrc-25682e6a495fc6669d799bb64acdaf14d653173e.tar.gz
src-25682e6a495fc6669d799bb64acdaf14d653173e.zip
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
-rw-r--r--sys/net/rtsock.c2
1 files changed, 1 insertions, 1 deletions
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);