diff options
author | qwx <qwx@sciops.net> | 2022-09-10 01:02:11 +0000 |
---|---|---|
committer | qwx <qwx@sciops.net> | 2022-09-10 01:02:11 +0000 |
commit | 63f10d4c945e3e692b589175508b95ce8dd9b50d (patch) | |
tree | f69b6071edb4e9554fac1e6ec871b6138313f2e0 | |
parent | efc7be7bdc01cb6bf079111d2e202991577ed125 (diff) |
ip/tinc: fix ping pong racing causing recalcs and deleting nodes
-rw-r--r-- | sys/src/cmd/ip/tinc.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/src/cmd/ip/tinc.c b/sys/src/cmd/ip/tinc.c index 268bc4cb0..d15002b71 100644 --- a/sys/src/cmd/ip/tinc.c +++ b/sys/src/cmd/ip/tinc.c @@ -1301,7 +1301,10 @@ metapeer(Conn *c) while((n = conrecv(c, f, nelem(f))) > 0){ switch(atoi(f[0])){ case PING: - if(consend(c, "%d %x", PONG, rand()) < 0) + netlock(c); + n = consend(c, "%d %x", PONG, rand()); + netunlock(c); + if(n < 0) return; continue; case PONG: |