summaryrefslogtreecommitdiff
path: root/modules/ice
diff options
context:
space:
mode:
authorAlfred E. Heggestad <alfred.heggestad@gmail.com>2017-09-16 09:44:16 +0200
committerAlfred E. Heggestad <alfred.heggestad@gmail.com>2017-09-16 09:44:16 +0200
commit6c37a7547c365dcbeef2b53f74152deb37b26191 (patch)
tree0ad43471d5494b5068cd3b4d15725dfac895723e /modules/ice
parent939a56fe68f696d5397b656cca698fd4e011bee4 (diff)
ice: set local role correctly (ref #292)
Diffstat (limited to 'modules/ice')
-rw-r--r--modules/ice/ice.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/ice/ice.c b/modules/ice/ice.c
index 374aeb5..02468fe 100644
--- a/modules/ice/ice.c
+++ b/modules/ice/ice.c
@@ -792,6 +792,7 @@ static int media_alloc(struct mnat_media **mp, struct mnat_sess *sess,
struct sdp_media *sdpm)
{
struct mnat_media *m;
+ enum ice_role role;
unsigned i;
int err = 0;
@@ -808,7 +809,12 @@ static int media_alloc(struct mnat_media **mp, struct mnat_sess *sess,
m->compv[0].sock = mem_ref(sock1);
m->compv[1].sock = mem_ref(sock2);
- err = icem_alloc(&m->icem, ice.mode, sess->offerer,
+ if (sess->offerer)
+ role = ICE_ROLE_CONTROLLING;
+ else
+ role = ICE_ROLE_CONTROLLED;
+
+ err = icem_alloc(&m->icem, ice.mode, role,
proto, ICE_LAYER,
sess->tiebrk, sess->lufrag, sess->lpwd,
conncheck_handler, m);