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.
This commit is contained in:
cinap_lenrek 2020-10-25 22:27:30 +01:00
parent 9bb519ac50
commit 950d970671

View file

@ -377,9 +377,9 @@ reportedge(Conn *c, Edge *e)
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