From 724ad13fe1fa66ef3e7acba8af34b02fbeccb597 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Tue, 7 Jul 2020 08:16:16 -0700 Subject: [PATCH] wgengine/tstun: fix alignment of 64-bit atomic field We had a test for it, but no 32-bit builder apparently. :( Fixes #529 --- wgengine/tstun/tun.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wgengine/tstun/tun.go b/wgengine/tstun/tun.go index b04714107..cdba27c8d 100644 --- a/wgengine/tstun/tun.go +++ b/wgengine/tstun/tun.go @@ -58,7 +58,8 @@ type TUN struct { // tdev is the underlying TUN device. tdev tun.Device - lastActivityAtomic int64 // unix seconds of last send or receive + _ [4]byte // force 64-bit alignment of following field on 32-bit + lastActivityAtomic int64 // unix seconds of last send or receive // buffer stores the oldest unconsumed packet from tdev. // It is made a static buffer in order to avoid allocations.