summaryrefslogtreecommitdiffhomepage
path: root/conn/sticky_linux.go
diff options
context:
space:
mode:
authorJordan Whited <jordan@tailscale.com>2023-03-14 20:28:07 -0700
committerJason A. Donenfeld <Jason@zx2c4.com>2023-03-16 17:45:41 +0100
commit07a1e55270bd34ee526ad328d597fa01a8e17619 (patch)
tree4f4ca5ed6665af1e2432f9b382d274bc968847a3 /conn/sticky_linux.go
parentfff53afca779078061128a5a10c31e67a7919d35 (diff)
conn: fix getSrcFromControl() iteration
We only expect a single control message in the normal case, but this would loop infinitely if there were more. Reviewed-by: Adrian Dewhurst <adrian@tailscale.com> Signed-off-by: Jordan Whited <jordan@tailscale.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'conn/sticky_linux.go')
-rw-r--r--conn/sticky_linux.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/conn/sticky_linux.go b/conn/sticky_linux.go
index 342e739..278eb19 100644
--- a/conn/sticky_linux.go
+++ b/conn/sticky_linux.go
@@ -25,7 +25,7 @@ func getSrcFromControl(control []byte, ep *StdNetEndpoint) {
)
for len(rem) > unix.SizeofCmsghdr {
- hdr, data, rem, err = unix.ParseOneSocketControlMessage(control)
+ hdr, data, rem, err = unix.ParseOneSocketControlMessage(rem)
if err != nil {
return
}