Commit 0f0a1b17 authored by Dafydd Harries's avatar Dafydd Harries

fix setting of transaction ID in responses to STUN requests

darcs-hash:20070123175146-c9803-2ff07145f3414aeed473900213ed2e24af95c176.gz
parent a26c7a4e
......@@ -461,6 +461,7 @@ ice_agent_recv (
gchar *packed;
response = stun_message_new (STUN_MESSAGE_BINDING_RESPONSE);
memcpy (response->transaction_id, msg->transaction_id, 16);
response->attributes = g_malloc0 (2 * sizeof (StunAttribute));
response->attributes[0] = stun_attribute_mapped_address_new (
ntohl (from.sin_addr.s_addr), ntohs (from.sin_port));
......
......@@ -53,6 +53,7 @@ main (void)
/* send binding request */
breq = stun_message_new (STUN_MESSAGE_BINDING_REQUEST);
memcpy (breq->transaction_id, "0123456789abcdef", 16);
packed_len = stun_message_pack (breq, &packed);
udp_fake_socket_push_recv (sock, &from, packed_len, packed);
g_free (packed);
......@@ -63,6 +64,7 @@ main (void)
/* construct expected response packet */
bres = stun_message_new (STUN_MESSAGE_BINDING_RESPONSE);
memcpy (bres->transaction_id, "0123456789abcdef", 16);
bres->attributes = g_malloc0 (2 * sizeof (StunAttribute *));
bres->attributes[0] = stun_attribute_mapped_address_new (
remote_addr.addr_ipv4, 5678);
......
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