Commit a74ceec9 authored by Youness Alaoui's avatar Youness Alaoui

This is a VERY UGLY HACK!

A google/msn data indication is 0x0115 which is contrary to the rfc3489bis which states that 8th and 12th bits are for the class and that 0x01 is for indications...
So 0x0115 is reported as a "connect error response", while it should be a data indication, which message type should actually be 0x0017
This should fix the issue, and it's considered safe since the "connect" method doesn't exist anymore
parent 60626732
......@@ -591,6 +591,16 @@ void stun_message_id (const StunMessage *msg, stun_transid_t id)
stun_method_t stun_message_get_method (const StunMessage *msg)
{
uint16_t t = stun_getw (msg->buffer);
/* HACK HACK HACK
A google/msn data indication is 0x0115 which is contrary to the rfc3489bis
which states that 8th and 12th bits are for the class and that 0x01 is
for indications...
So 0x0115 is reported as a "connect error response", while it should be
a data indication, which message type should actually be 0x0017
This should fix the issue, and it's considered safe since the "connect"
method doesn't exist anymore */
if (t == 0x0115)
t = 0x0017;
return (stun_method_t)(((t & 0x3e00) >> 2) | ((t & 0x00e0) >> 1) |
(t & 0x000f));
}
......@@ -602,6 +612,16 @@ stun_method_t stun_message_get_method (const StunMessage *msg)
stun_class_t stun_message_get_class (const StunMessage *msg)
{
uint16_t t = stun_getw (msg->buffer);
/* HACK HACK HACK
A google/msn data indication is 0x0115 which is contrary to the rfc3489bis
which states that 8th and 12th bits are for the class and that 0x01 is
for indications...
So 0x0115 is reported as a "connect error response", while it should be
a data indication, which message type should actually be 0x0017
This should fix the issue, and it's considered safe since the "connect"
method doesn't exist anymore */
if (t == 0x0115)
t = 0x0017;
return (stun_class_t)(((t & 0x0100) >> 7) | ((t & 0x0010) >> 4));
}
......
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