1
0
mirror of https://git.zx2c4.com/wireguard-go synced 2024-11-15 01:05:15 +01:00
wireguard-go/device
David Anderson d49f4e9fe3 device: make Peer fields safe for atomic access on 32-bit.
All atomic access must be aligned to 64 bits, even on 32-bit
platforms. Go promises that the start of allocated structs is
aligned to 64 bits. So, place the atomically-accessed things
first in the struct so that they benefit from that alignment.

As a side bonus, it cleanly separates fields that are accessed
by atomic ops, and those that should be accessed under mu.

Also adds a test that will fail consistently on 32-bit platforms
if the struct ever changes again to violate the rules. This is
likely not needed because unaligned access crashes reliably,
but this will reliably fail even if tests accidentally pass due
to lucky alignment.

Signed-Off-By: David Anderson <danderson@tailscale.com>
2020-03-30 20:10:36 +11:00
..
allowedips_rand_test.go global: begin modularization 2019-03-03 05:00:40 +01:00
allowedips_test.go global: begin modularization 2019-03-03 05:00:40 +01:00
allowedips.go global: begin modularization 2019-03-03 05:00:40 +01:00
bind_test.go global: begin modularization 2019-03-03 05:00:40 +01:00
boundif_android.go device: fail to give bind if it doesn't exist 2019-05-17 15:35:20 +02:00
boundif_windows.go device: allow blackholing sockets 2019-10-21 13:29:57 +02:00
conn_default.go device: allow blackholing sockets 2019-10-21 13:29:57 +02:00
conn_linux.go global: use RTMGRP_* consts from x/sys/unix 2020-03-17 23:07:11 -06:00
conn.go global: regroup all imports 2019-05-14 09:09:52 +02:00
constants.go constants: recalculate rekey max based on a one minute flood 2019-10-30 14:29:32 +01:00
cookie_test.go global: begin modularization 2019-03-03 05:00:40 +01:00
cookie.go device, ratelimiter: replace uses of time.Now().Sub() with time.Since() 2019-06-03 22:15:41 +02:00
device_test.go device: test packets between two fake devices 2019-10-16 11:38:28 +02:00
device.go noise: unify zero checking of ecdh 2020-03-17 23:07:14 -06:00
endpoint_test.go global: begin modularization 2019-03-03 05:00:40 +01:00
indextable.go global: begin modularization 2019-03-03 05:00:40 +01:00
ip.go global: begin modularization 2019-03-03 05:00:40 +01:00
kdf_test.go global: regroup all imports 2019-05-14 09:09:52 +02:00
keypair.go global: regroup all imports 2019-05-14 09:09:52 +02:00
logger.go global: begin modularization 2019-03-03 05:00:40 +01:00
mark_default.go boundif: introduce API for socket binding 2019-03-04 16:37:11 +01:00
mark_unix.go global: regroup all imports 2019-05-14 09:09:52 +02:00
misc.go global: begin modularization 2019-03-03 05:00:40 +01:00
noise_test.go global: begin modularization 2019-03-03 05:00:40 +01:00
noise-helpers.go device: remove redundant return statements 2019-06-04 13:01:52 +02:00
noise-protocol.go noise: unify zero checking of ecdh 2020-03-17 23:07:14 -06:00
noise-types.go uapi: allow unsetting device private key with /dev/null 2020-02-04 22:02:53 +01:00
peer_test.go device: make Peer fields safe for atomic access on 32-bit. 2020-03-30 20:10:36 +11:00
peer.go device: make Peer fields safe for atomic access on 32-bit. 2020-03-30 20:10:36 +11:00
pools.go global: begin modularization 2019-03-03 05:00:40 +01:00
queueconstants_android.go receive: implement flush semantics 2019-03-21 14:45:41 -06:00
queueconstants_default.go tun: import mobile particularities 2019-03-04 16:37:11 +01:00
queueconstants_ios.go tun: import mobile particularities 2019-03-04 16:37:11 +01:00
receive.go device: receive: uniform message for source address check 2019-07-01 15:24:50 +02:00
send.go send: account for zero mtu 2020-02-14 18:53:55 +01:00
timers.go device: timers: add jitter on ack failure reinitiation 2019-05-24 13:48:25 +02:00
tun_test.go tun: remove TUN prefix from types to reduce stutter elsewhere 2019-06-14 18:35:57 +02:00
tun.go tun: remove TUN prefix from types to reduce stutter elsewhere 2019-06-14 18:35:57 +02:00
uapi.go uapi: allow unsetting device private key with /dev/null 2020-02-04 22:02:53 +01:00
version.go version: bump snapshot 2020-03-20 12:00:53 -06:00