Commit f2969044 authored by Youness Alaoui's avatar Youness Alaoui

Correctly check if the method of the stun response is correct in the stun usages process functions

parent 6f427b19
...@@ -72,6 +72,9 @@ StunUsageBindReturn stun_usage_bind_process (StunMessage *msg, ...@@ -72,6 +72,9 @@ StunUsageBindReturn stun_usage_bind_process (StunMessage *msg,
{ {
int val, code = -1; int val, code = -1;
if (stun_message_get_method (msg) != STUN_BINDING)
return STUN_USAGE_BIND_RETURN_RETRY;
switch (stun_message_get_class (msg)) switch (stun_message_get_class (msg))
{ {
case STUN_REQUEST: case STUN_REQUEST:
......
...@@ -100,6 +100,9 @@ StunUsageIceReturn stun_usage_ice_conncheck_process (StunMessage *msg, ...@@ -100,6 +100,9 @@ StunUsageIceReturn stun_usage_ice_conncheck_process (StunMessage *msg,
{ {
int val, code = -1; int val, code = -1;
if (stun_message_get_method (msg) != STUN_BINDING)
return STUN_USAGE_ICE_RETURN_RETRY;
switch (stun_message_get_class (msg)) switch (stun_message_get_class (msg))
{ {
case STUN_REQUEST: case STUN_REQUEST:
......
...@@ -207,6 +207,9 @@ StunUsageTurnReturn stun_usage_turn_process (StunMessage *msg, ...@@ -207,6 +207,9 @@ StunUsageTurnReturn stun_usage_turn_process (StunMessage *msg,
int val, code = -1; int val, code = -1;
StunUsageTurnReturn ret = STUN_USAGE_TURN_RETURN_RELAY_SUCCESS; StunUsageTurnReturn ret = STUN_USAGE_TURN_RETURN_RELAY_SUCCESS;
if (stun_message_get_method (msg) != STUN_ALLOCATE)
return STUN_USAGE_TURN_RETURN_RETRY;
switch (stun_message_get_class (msg)) switch (stun_message_get_class (msg))
{ {
case STUN_REQUEST: case STUN_REQUEST:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment