Commit f02e4d6b authored by Olivier Crête's avatar Olivier Crête

agent: Use 1280 instead of 65536 buffer size to send STUN Message

RFC 5389 says:
   All STUN messages sent over UDP SHOULD be less than the path MTU, if
   known.  If the path MTU is unknown, messages SHOULD be the smaller of
   576 bytes and the first-hop MTU for IPv4 [RFC1122] and 1280 bytes for
   IPv6 [RFC2460].

So sending 65536 bytes is always wrong
parent 1fbc68a2
......@@ -74,7 +74,7 @@ struct _CandidatePairKeepalive
guint stream_id;
guint component_id;
StunTimer timer;
uint8_t stun_buffer[STUN_MAX_MESSAGE_SIZE];
uint8_t stun_buffer[STUN_MAX_MESSAGE_SIZE_IPV6];
StunMessage stun_message;
};
......
......@@ -666,7 +666,7 @@ static gboolean priv_conn_keepalive_tick_unlocked (NiceAgent *agent)
NiceAddress stun_server;
if (nice_address_set_from_string (&stun_server, agent->stun_server_ip)) {
StunAgent stun_agent;
uint8_t stun_buffer[STUN_MAX_MESSAGE_SIZE];
uint8_t stun_buffer[STUN_MAX_MESSAGE_SIZE_IPV6];
StunMessage stun_message;
size_t buffer_len = 0;
......
......@@ -77,7 +77,7 @@ struct _CandidateCheckPair
guint64 priority;
GTimeVal next_tick; /* next tick timestamp */
StunTimer timer;
uint8_t stun_buffer[STUN_MAX_MESSAGE_SIZE];
uint8_t stun_buffer[STUN_MAX_MESSAGE_SIZE_IPV6];
StunMessage stun_message;
};
......
......@@ -58,7 +58,7 @@ typedef struct
TurnServer *turn;
StunAgent stun_agent;
StunTimer timer;
uint8_t stun_buffer[STUN_MAX_MESSAGE_SIZE];
uint8_t stun_buffer[STUN_MAX_MESSAGE_SIZE_IPV6];
StunMessage stun_message;
uint8_t stun_resp_buffer[STUN_MAX_MESSAGE_SIZE];
StunMessage stun_resp_msg;
......@@ -76,7 +76,7 @@ typedef struct
GSource *timer_source;
GSource *tick_source;
StunTimer timer;
uint8_t stun_buffer[STUN_MAX_MESSAGE_SIZE];
uint8_t stun_buffer[STUN_MAX_MESSAGE_SIZE_IPV6];
StunMessage stun_message;
uint8_t stun_resp_buffer[STUN_MAX_MESSAGE_SIZE];
StunMessage stun_resp_msg;
......
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