ref: a955a79cea0db0bba3fbe582c4de01e38633e33e
parent: 641fd7a10c25956c90d82454995e0ed41a0c4897
author: qwx <qwx@sciops.net>
date: Fri Sep 9 21:02:11 EDT 2022
ip/tinc: fix ping pong racing causing recalcs and deleting nodes
--- a/sys/src/cmd/ip/tinc.c
+++ b/sys/src/cmd/ip/tinc.c
@@ -1301,7 +1301,10 @@
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:
--
⑨