From d418ada288892e835119f82a9a9819e1fd842115 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Fri, 14 Sep 2007 09:30:25 +0000 Subject: Fixed ticket #368: STUN keep-alive timed out when ICE is used git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1433 74dad513-b988-da41-8d7b-12977e46ad98 --- pjnath/src/pjnath/ice_strans.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'pjnath') diff --git a/pjnath/src/pjnath/ice_strans.c b/pjnath/src/pjnath/ice_strans.c index d789b993..e66b154a 100644 --- a/pjnath/src/pjnath/ice_strans.c +++ b/pjnath/src/pjnath/ice_strans.c @@ -476,9 +476,9 @@ static void on_read_complete(pj_ioqueue_key_t *key, PJ_STUN_IS_DATAGRAM); if (status == PJ_SUCCESS) { - if (ice_st->ice==NULL && - (comp->stun_sess && - pj_memcmp(comp->pkt+8, comp->ka_tsx_id, 12) == 0)) + if (comp->stun_sess && + PJ_STUN_IS_RESPONSE(((pj_stun_msg_hdr*)comp->pkt)->type) && + pj_memcmp(comp->pkt+8, comp->ka_tsx_id, 12) == 0) { status = pj_stun_session_on_rx_pkt(comp->stun_sess, comp->pkt, bytes_read, @@ -499,7 +499,9 @@ static void on_read_complete(pj_ioqueue_key_t *key, &comp->src_addr, comp->src_addr_len); } else { - /* This must have been a very late STUN reponse */ + /* This must have been a very late STUN reponse, + * or an early STUN Binding Request when our local + * ICE has not been created yet. */ } } else { (*ice_st->cb.on_rx_data)(ice_st, comp->comp_id, -- cgit v1.2.3