summaryrefslogtreecommitdiff
path: root/stun
diff options
context:
space:
mode:
authorYouness Alaoui <youness.alaoui@collabora.co.uk>2009-11-04 13:04:48 -0500
committerYouness Alaoui <youness.alaoui@collabora.co.uk>2009-11-04 13:04:48 -0500
commit27c22fb8f0b74ee8395576b522000bffa00d4fb3 (patch)
tree65831e78e3101547863af7bdeadd85bcf3b3761f /stun
parent8eab0facb3285ad43b3dc411e583d35a287a06eb (diff)
downloadlibnice-27c22fb8f0b74ee8395576b522000bffa00d4fb3.tar.gz
add SOFTWARE attribute only if we're in the right compatibility mode
Diffstat (limited to 'stun')
-rw-r--r--stun/stunagent.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/stun/stunagent.c b/stun/stunagent.c
index 68c81c3..3fef2bb 100644
--- a/stun/stunagent.c
+++ b/stun/stunagent.c
@@ -359,9 +359,9 @@ bool stun_agent_init_request (StunAgent *agent, StunMessage *msg,
uint32_t cookie = htonl (STUN_MAGIC_COOKIE);
memcpy (msg->buffer + STUN_MESSAGE_TRANS_ID_POS, &cookie, sizeof (cookie));
}
- if (agent->software_attribute != NULL ||
- ((agent->compatibility == STUN_COMPATIBILITY_RFC5389 ||
+ if ((agent->compatibility == STUN_COMPATIBILITY_RFC5389 ||
agent->compatibility == STUN_COMPATIBILITY_WLM2009) &&
+ (agent->software_attribute != NULL ||
agent->usage_flags & STUN_AGENT_USAGE_ADD_SOFTWARE)) {
stun_message_append_software (msg, agent->software_attribute);
}
@@ -423,9 +423,9 @@ bool stun_agent_init_response (StunAgent *agent, StunMessage *msg,
if (stun_message_init (msg, STUN_RESPONSE,
stun_message_get_method (request), id)) {
- if (agent->software_attribute != NULL ||
- ((agent->compatibility == STUN_COMPATIBILITY_RFC5389 ||
+ if ((agent->compatibility == STUN_COMPATIBILITY_RFC5389 ||
agent->compatibility == STUN_COMPATIBILITY_WLM2009) &&
+ (agent->software_attribute != NULL ||
agent->usage_flags & STUN_AGENT_USAGE_ADD_SOFTWARE)) {
stun_message_append_software (msg, agent->software_attribute);
}
@@ -460,9 +460,9 @@ bool stun_agent_init_error (StunAgent *agent, StunMessage *msg,
if (stun_message_init (msg, STUN_ERROR,
stun_message_get_method (request), id)) {
- if (agent->software_attribute != NULL ||
- ((agent->compatibility == STUN_COMPATIBILITY_RFC5389 ||
+ if ((agent->compatibility == STUN_COMPATIBILITY_RFC5389 ||
agent->compatibility == STUN_COMPATIBILITY_WLM2009) &&
+ (agent->software_attribute != NULL ||
agent->usage_flags & STUN_AGENT_USAGE_ADD_SOFTWARE)) {
stun_message_append_software (msg, agent->software_attribute);
}