]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
update
authorAnthony Minessale <anthony.minessale@gmail.com>
Mon, 21 Jul 2008 16:48:05 +0000 (16:48 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Mon, 21 Jul 2008 16:48:05 +0000 (16:48 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9123 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_stun.c

index de0c4b4e8ff88d98222e5ee2d1bd68218923afbb..545462eecbe2400b6e5e345a780847e5a4ea5fad 100644 (file)
@@ -493,6 +493,10 @@ SWITCH_DECLARE(switch_status_t) switch_stun_lookup(char **ip,
        if (funny) {
                packet = (switch_stun_packet_t *) buf;
                bytes += 4;
+               buf[bytes++] = 0;
+               buf[bytes++] = 0;
+               buf[bytes++] = 0;
+               buf[bytes++] = 0;
        }
        
        switch_socket_sendto(sock, remote_addr, 0, (void *) packet, &bytes);
@@ -534,6 +538,10 @@ SWITCH_DECLARE(switch_status_t) switch_stun_lookup(char **ip,
                switch (attr->type) {
                case SWITCH_STUN_ATTR_MAPPED_ADDRESS:
                        if (attr->type) {
+                               if(funny)
+                               {
+                                       ((switch_stun_ip_t *) attr->value)->address ^= ntohl(0xabcdabcd);
+                               }
                                switch_stun_packet_attribute_get_mapped_address(attr, rip, &rport);
                        }
                        break;