Browse Source

MT#55283 rekernelize after DTLS connect

Change-Id: I468b6c07df96111ee49a85e36382a692dbeec82b
(cherry picked from commit 7b1557cc1e)
(cherry picked from commit 4ee17cf21b)
mr12.5.1
Richard Fuchs 1 year ago
parent
commit
9cb5b644a0
3 changed files with 12 additions and 2 deletions
  1. +3
    -1
      daemon/call.c
  2. +4
    -1
      daemon/dtls.c
  3. +5
    -0
      daemon/media_socket.c

+ 3
- 1
daemon/call.c View File

@ -1102,8 +1102,10 @@ enum call_stream_state call_stream_state_machine(struct packet_stream *ps) {
mutex_lock(&ps->in_lock);
struct dtls_connection *d = dtls_ptr(ps->selected_sfd);
if (d && d->init && !d->connected) {
dtls(ps->selected_sfd, NULL, NULL);
int dret = dtls(ps->selected_sfd, NULL, NULL);
mutex_unlock(&ps->in_lock);
if (dret == 1)
call_media_unkernelize(media, "DTLS connected");
return CSS_DTLS;
}
mutex_unlock(&ps->in_lock);


+ 4
- 1
daemon/dtls.c View File

@ -820,6 +820,8 @@ int dtls(stream_fd *sfd, const str *s, const endpoint_t *fsin) {
MEDIA_CLEAR(ps->media, SDES);
}
int dret = 0;
ret = try_connect(d);
if (ret == -1) {
ilogs(srtp, LOG_ERROR, "DTLS error on local port %u", sfd->socket.local.port);
@ -834,6 +836,7 @@ int dtls(stream_fd *sfd, const str *s, const endpoint_t *fsin) {
}
else if (ret == 1) {
/* connected! */
dret = 1;
mutex_lock(&ps->out_lock); // nested lock!
if (dtls_setup_crypto(ps, d))
{} /* XXX ?? */
@ -889,7 +892,7 @@ int dtls(stream_fd *sfd, const str *s, const endpoint_t *fsin) {
}
}
return 0;
return dret;
}
/* call must be locked */


+ 5
- 0
daemon/media_socket.c View File

@ -2035,6 +2035,11 @@ static int media_demux_protocols(struct packet_handler_ctx *phc) {
mutex_lock(&phc->mp.stream->in_lock);
int ret = dtls(phc->mp.sfd, &phc->s, &phc->mp.fsin);
if (ret == 1) {
phc->unkernelize = "DTLS connected";
phc->unkernelize_subscriptions = true;
ret = 0;
}
mutex_unlock(&phc->mp.stream->in_lock);
if (!ret)
return 0;


Loading…
Cancel
Save