Ignore:
Timestamp:
Apr 13, 2008 9:48:44 PM (14 years ago)
Author:
bennylp
Message:

More ticket #485: fixed TURN server permission not allowing peer with the same IP to get through, and added option to disable FINGERPRINT verification in TURN server since it is currently broken when TURN is used with ICE (which has a FINGERPRINT in its Binding Request)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjnath/src/pjturn-srv/allocation.c

    r1913 r1924  
    826826    perm->expiry.sec += PJ_TURN_PERM_TIMEOUT; 
    827827 
    828     /* Register to hash table */ 
    829     pj_hash_set(alloc->pool, alloc->peer_table, &perm->hkey.peer_addr,  
    830                 pj_sockaddr_get_len(&perm->hkey.peer_addr), 0, perm); 
     828    /* Register to hash table (only the address part!) */ 
     829    pj_hash_set(alloc->pool, alloc->peer_table,  
     830                pj_sockaddr_get_addr(&perm->hkey.peer_addr),  
     831                pj_sockaddr_get_addr_len(&perm->hkey.peer_addr), 0, perm); 
    831832 
    832833    return perm; 
     
    846847 
    847848    /* Remove from permission hash table */ 
    848     pj_hash_set(NULL, alloc->peer_table, &perm->hkey.peer_addr,  
    849                 pj_sockaddr_get_len(&perm->hkey.peer_addr), 0, NULL); 
     849    pj_hash_set(NULL, alloc->peer_table,  
     850                pj_sockaddr_get_addr(&perm->hkey.peer_addr),  
     851                pj_sockaddr_get_addr_len(&perm->hkey.peer_addr), 0, NULL); 
    850852 
    851853    /* Remove from channel hash table, if assigned a channel number */ 
     
    866868    pj_turn_permission *perm; 
    867869 
     870    PJ_UNUSED_ARG(addr_len); 
     871 
    868872    /* Lookup in peer hash table */ 
    869     perm = (pj_turn_permission*) pj_hash_get(alloc->peer_table, peer_addr, 
    870                                              addr_len, NULL); 
     873    perm = (pj_turn_permission*)  
     874           pj_hash_get(alloc->peer_table,  
     875                       pj_sockaddr_get_addr(peer_addr), 
     876                       pj_sockaddr_get_addr_len(peer_addr),  
     877                       NULL); 
    871878    return perm ? check_permission_expiry(perm) : NULL; 
    872879} 
     
    921928         * our stun_on_rx_request() or stun_on_rx_indication() 
    922929         * callbacks. 
     930         * 
     931         * Note: currently it is necessary to specify the  
     932         * PJ_STUN_NO_FINGERPRINT_CHECK otherwise the FINGERPRINT 
     933         * attribute inside STUN Send Indication message will mess up 
     934         * with fingerprint checking. 
    923935         */ 
    924         unsigned options = PJ_STUN_CHECK_PACKET; 
     936        unsigned options = PJ_STUN_CHECK_PACKET | PJ_STUN_NO_FINGERPRINT_CHECK; 
    925937        unsigned parsed_len = 0; 
    926938 
Note: See TracChangeset for help on using the changeset viewer.