From 20f33e56ffb666cfb783e36ced12dc23d550a4ab Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Wed, 6 Feb 2013 13:11:07 -0500 Subject: [PATCH] treat zero ip/port as wildcard when matching up old streams --- daemon/call.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/daemon/call.c b/daemon/call.c index f2b4daaf4..78f13e46e 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -1229,9 +1229,13 @@ static int call_streams(struct call *c, GQueue *s, const str *tag, enum call_opm IP6P(&matched_relay->peer_advertised.ip46), matched_relay->peer_advertised.port, STR_FMT(&cs_o->peers[x].tag)); - if (!IN6_ARE_ADDR_EQUAL(&matched_relay->peer_advertised.ip46, &t->stream.ip46)) + if (!IN6_ARE_ADDR_EQUAL(&matched_relay->peer_advertised.ip46, &t->stream.ip46) + && !is_addr_unspecified(&matched_relay->peer_advertised.ip46) + && !is_addr_unspecified(&t->stream.ip46)) continue; - if (matched_relay->peer_advertised.port != t->stream.port) + if (matched_relay->peer_advertised.port != t->stream.port + && matched_relay->peer_advertised.port + && t->stream.port) continue; if (str_cmp_str0(&cs_o->peers[x].tag, tag)) continue; @@ -1326,7 +1330,11 @@ got_cs: if (matched_relay && p == matched_relay->up) { /* best case, nothing to do */ DBG("case 1"); - ; + /* ... unless we (un)silenced the stream, in which case + we need to copy the new information */ + if (!IN6_ARE_ADDR_EQUAL(&matched_relay->peer_advertised.ip46, &t->stream.ip46) + || matched_relay->peer_advertised.port != t->stream.port) + setup_peer(p, t, tag); } else if (matched_relay && cs_o != cs) { /* found something, but it's linked to a different stream */