From 6d3aefb8257f52f5e2d075464efcc5f39ec75244 Mon Sep 17 00:00:00 2001 From: Arceliar Date: Sun, 27 Oct 2019 19:55:35 -0500 Subject: [PATCH] fix a data race when an existing session's coords are updated in response to a successful search --- src/yggdrasil/search.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/yggdrasil/search.go b/src/yggdrasil/search.go index caa8df7c..f52dcbe8 100644 --- a/src/yggdrasil/search.go +++ b/src/yggdrasil/search.go @@ -192,7 +192,7 @@ func (sinfo *searchInfo) checkDHTRes(res *dhtRes) bool { finishSearch := func(sess *sessionInfo, err error) { if sess != nil { // FIXME (!) replay attacks could mess with coords? Give it a handle (tstamp)? - sess.coords = res.Coords + sess.Act(sinfo.searches.router, func() { sess.coords = res.Coords }) sess.ping(sinfo.searches.router) } if err != nil {