stun: Restore argument type to stun_usage_bind_process(), it's used outside libnice
authorOlivier Crête <olivier.crete@collabora.com>
Wed, 16 Apr 2014 03:18:21 +0000 (23:18 -0400)
committerOlivier Crête <olivier.crete@collabora.com>
Wed, 16 Apr 2014 03:22:09 +0000 (23:22 -0400)
agent/conncheck.c
stun/usages/bind.c
stun/usages/bind.h

index d202d69..5c55317 100644 (file)
@@ -2267,8 +2267,8 @@ static gboolean priv_map_reply_to_discovery_request (NiceAgent *agent, StunMessa
       stun_message_id (&d->stun_message, discovery_id);
 
       if (memcmp (discovery_id, response_id, sizeof(StunTransactionId)) == 0) {
-        res = stun_usage_bind_process (resp, &sockaddr.storage,
-            &socklen, &alternate.storage, &alternatelen);
+        res = stun_usage_bind_process (resp, &sockaddr.addr,
+            &socklen, &alternate.addr, &alternatelen);
         nice_debug ("Agent %p : stun_bind_process/disc for %p res %d.",
             agent, d, (int)res);
 
index 69008c4..eeb6039 100644 (file)
@@ -94,8 +94,8 @@ size_t stun_usage_bind_create (StunAgent *agent, StunMessage *msg,
 }
 
 StunUsageBindReturn stun_usage_bind_process (StunMessage *msg,
-    struct sockaddr_storage *addr, socklen_t *addrlen,
-    struct sockaddr_storage *alternate_server, socklen_t *alternate_server_len)
+    struct sockaddr *addr, socklen_t *addrlen,
+    struct sockaddr *alternate_server, socklen_t *alternate_server_len)
 {
   int code = -1;
   StunMessageReturn val;
@@ -126,7 +126,7 @@ StunUsageBindReturn stun_usage_bind_process (StunMessage *msg,
       if ((code / 100) == 3) {
         if (alternate_server && alternate_server_len) {
           if (stun_message_find_addr (msg, STUN_ATTRIBUTE_ALTERNATE_SERVER,
-                  alternate_server,
+                  (struct sockaddr_storage *) alternate_server,
                   alternate_server_len) != STUN_MESSAGE_RETURN_SUCCESS) {
             stun_debug (" Unexpectedly missing ALTERNATE-SERVER attribute\n");
             return STUN_USAGE_BIND_RETURN_ERROR;
@@ -152,12 +152,14 @@ StunUsageBindReturn stun_usage_bind_process (StunMessage *msg,
   stun_debug ("Received %u-bytes STUN message\n", stun_message_length (msg));
 
   val = stun_message_find_xor_addr (msg,
-      STUN_ATTRIBUTE_XOR_MAPPED_ADDRESS, addr, addrlen);
+      STUN_ATTRIBUTE_XOR_MAPPED_ADDRESS, (struct sockaddr_storage *)addr,
+      addrlen);
   if (val != STUN_MESSAGE_RETURN_SUCCESS)
   {
     stun_debug (" No XOR-MAPPED-ADDRESS: %d\n", val);
     val = stun_message_find_addr (msg,
-        STUN_ATTRIBUTE_MAPPED_ADDRESS, addr, addrlen);
+        STUN_ATTRIBUTE_MAPPED_ADDRESS, (struct sockaddr_storage *)addr,
+        addrlen);
     if (val != STUN_MESSAGE_RETURN_SUCCESS)
     {
       stun_debug (" No MAPPED-ADDRESS: %d\n", val);
@@ -529,8 +531,8 @@ StunUsageBindReturn stun_usage_bind_run (const struct sockaddr *srv,
     if (valid != STUN_VALIDATION_SUCCESS) {
       ret = STUN_USAGE_TRANS_RETURN_RETRY;
     } else {
-      bind_ret = stun_usage_bind_process (&msg, addr, addrlen,
-          &alternate_server, &alternate_server_len);
+      bind_ret = stun_usage_bind_process (&msg, (struct sockaddr *)  addr,
+          addrlen, (struct sockaddr *) &alternate_server, &alternate_server_len);
       if (bind_ret == STUN_USAGE_BIND_RETURN_ALTERNATE_SERVER) {
         stun_trans_deinit (&trans);
 
index b34287c..500f9fe 100644 (file)
@@ -121,8 +121,8 @@ size_t stun_usage_bind_create (StunAgent *agent, StunMessage *msg,
  * Note that #STUN_USAGE_BIND_RETURN_TIMEOUT cannot be returned by this function
  */
 StunUsageBindReturn stun_usage_bind_process (StunMessage *msg,
-    struct sockaddr_storage *addr, socklen_t *addrlen,
-    struct sockaddr_storage *alternate_server, socklen_t *alternate_server_len);
+    struct sockaddr *addr, socklen_t *addrlen,
+    struct sockaddr *alternate_server, socklen_t *alternate_server_len);
 
 /**
  * stun_usage_bind_keepalive: