don't relearn addresses if the endpoint hasn't changed

changes/24/1624/1
Richard Fuchs 11 years ago
parent b1085970c3
commit 93294f8c5f

@ -1863,15 +1863,21 @@ static int __num_media_streams(struct call_media *media, unsigned int num_ports)
return ret; return ret;
} }
static void __fill_stream(struct packet_stream *ps, const struct endpoint *ep, unsigned int port_off) { static void __fill_stream(struct packet_stream *ps, const struct endpoint *epp, unsigned int port_off) {
ps->endpoint = *ep; struct endpoint ep;
ps->endpoint.port += port_off;
ep = *epp;
ep.port += port_off;
/* if the endpoint hasn't changed, we do nothing */
if (PS_ISSET(ps, FILLED) && !memcmp(&ps->advertised_endpoint, &ep, sizeof(ep)))
return;
ps->endpoint = ep;
ps->advertised_endpoint = ep;
/* we reset crypto params whenever the endpoint changes */ /* we reset crypto params whenever the endpoint changes */
if (PS_ISSET(ps, FILLED) && memcmp(&ps->advertised_endpoint, &ps->endpoint, sizeof(ps->endpoint))) { crypto_reset(&ps->crypto);
crypto_reset(&ps->crypto); dtls_shutdown(ps);
dtls_shutdown(ps);
}
ps->advertised_endpoint = ps->endpoint;
PS_SET(ps, FILLED); PS_SET(ps, FILLED);
} }

Loading…
Cancel
Save