shithub: riscv

Download patch

ref: 950d970671a9432a5525dc3781a9095c04a50331
parent: 9bb519ac5023238572e31dd69d4f6dc3f45dfa26
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sun Oct 25 18:27:30 EDT 2020

ip/tinc: fix reportedge()

supplying a non-ip address in ADD_EDGE crashes the unix tincd.

the reason was that we where misreporting ADD_EDGE messages;
ignoring the information from our peers; and always supplying
the Address string from our configuration instead of the
connections ip address.

now we just report the edge information as is.

--- a/sys/src/cmd/ip/tinc.c
+++ b/sys/src/cmd/ip/tinc.c
@@ -377,9 +377,9 @@
 		consend(c, "%d %x %s %s", DEL_EDGE, rand(),
 			e->src->name, e->dst->name);
 	} else
-		consend(c, "%d %x %s %s %s %d %x %d", ADD_EDGE, rand(),
+		consend(c, "%d %x %s %s %I %d %x %d", ADD_EDGE, rand(),
 			e->src->name, e->dst->name,
-			e->dst->addr, e->dst->port, e->dst->options, e->weight);
+			e->ip, e->port, e->options, e->weight);
 }
 
 void