diff options
author | 2008-07-28 19:38:07 +0000 | |
---|---|---|
committer | 2008-07-28 19:38:07 +0000 | |
commit | bb7f092270f3f2320585e16af22024d3cc8f874c (patch) | |
tree | 91ddff81f451a2730c5fc9e2e47f30aad0da9c7c | |
parent | No longer clear ci_want_resched within cpu_switchto(), now that it's done (diff) | |
download | wireguard-openbsd-bb7f092270f3f2320585e16af22024d3cc8f874c.tar.xz wireguard-openbsd-bb7f092270f3f2320585e16af22024d3cc8f874c.zip |
Align the route message length to the next natural boundary via ALIGN() to
ensure that the next message is nicely aligned as well. Some archs (sparc, m88k)have strict alignement issues since the inclusion of 64bit counters in the
messages because those values could end up on non aligned addresses.
Found and fix tested by miod@, OK deraadt@
-rw-r--r-- | sys/net/rtsock.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index 6f18a5bece9..19bb0ef661a 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rtsock.c,v 1.73 2008/06/13 21:49:57 claudio Exp $ */ +/* $OpenBSD: rtsock.c,v 1.74 2008/07/28 19:38:07 claudio Exp $ */ /* $NetBSD: rtsock.c,v 1.18 1996/03/29 00:32:10 cgd Exp $ */ /* @@ -713,6 +713,8 @@ again: } len += dlen; } + /* align message length to the next natural boundary */ + len = ALIGN(len); if (cp == 0 && w != NULL && !second_time) { struct walkarg *rw = w; |