From 4552f20a41293e2d005f9ef40c5811ee4d630b0a 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 Conflicts: daemon/call.c --- daemon/call.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/daemon/call.c b/daemon/call.c index 927cbab05..bd69e4565 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -1210,9 +1210,13 @@ static int call_streams(struct call *c, GQueue *s, const char *tag, int opmode) IP6P(&t->ip46), t->port, tag, IP6P(&r->peer_advertised.ip46), r->peer_advertised.port, cs_o->peers[x].tag); - if (!IN6_ARE_ADDR_EQUAL(&r->peer_advertised.ip46, &t->ip46)) + if (!IN6_ARE_ADDR_EQUAL(&r->peer_advertised.ip46, &t->ip46) + && !is_addr_unspecified(&r->peer_advertised.ip46) + && !is_addr_unspecified(&t->ip46)) continue; - if (r->peer_advertised.port != t->port) + if (r->peer_advertised.port != t->port + && r->peer_advertised.port + && t->port) continue; if (strcmp(cs_o->peers[x].tag, tag)) continue; @@ -1306,7 +1310,11 @@ got_cs: if (r && p == r->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 (r && cs_o != cs) { /* found something, but it's linked to a different stream */