Changes between Initial Version and Version 1 of Ticket #1058


Ignore:
Timestamp:
Apr 26, 2010 7:03:56 AM (14 years ago)
Author:
bennylp
Comment:

Changing the title and description, as this probably is 64bit specific. This system is affected:

$ uname -a
Linux x200s 2.6.31-20-generic #58-Ubuntu SMP Fri Mar 12 04:38:19 UTC 2010 x86_64 GNU/Linux
$ gcc -v
Using built-in specs.
Target: x86_64-linux-gnu
..
gcc version 4.4.1 (Ubuntu 4.4.1-4ubuntu9)

while this system is not:

$ uname -a
nanang-desktop 2.6.28-11-generic #42-Ubuntu SMP Fri Apr 17 01:57:59 UTC 2009 i686 GNU/Linux
$ gcc -v
gcc version 4.3.3 (Ubuntu 4.3.3-5ubuntu4)

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #1058

    • Property Summary changed from Structure pj_sockaddr_in6 has different size than native sockaddr_in6 on Linux to Different size between pj_sockaddr_in6 and native sockaddr_in6 on 64bit systems, causing failure in using SIP IPv6 UDP transport
  • Ticket #1058 – Description

    initial v1  
    1 On Linux, {{{sizeof(struct sockaddr_in6)}}} is 28 bytes, while {{{sizeof(pj_sockaddr_in6)}}} is 32 bytes. This is because {{{struct pj_in6_addr}}} is aligned to 8 bytes: 
     1On 64bit Linux: 
    22 
    3 {{{ 
    4 typedef union pj_in6_addr 
    5 { 
    6     /* This is the main entry */ 
    7     pj_uint8_t  s6_addr[16];   /**< 8-bit array */ 
     3 {{{sizeof(struct sockaddr_in6)}}} is 28 bytes, 
    84 
    9     /* While these are used for proper alignment */ 
    10     pj_uint32_t u6_addr32[4]; 
     5 {{{sizeof(pj_sockaddr_in6)}}} is 32 bytes.  
    116 
    12     /* Do not use this with Winsock2, as this will align pj_sockaddr_in6 
    13      * to 64-bit boundary and Winsock2 doesn't like it! 
    14      */ 
    15 #if defined(PJ_HAS_INT64) && PJ_HAS_INT64!=0 && \ 
    16     (!defined(PJ_WIN32) || PJ_WIN32==0) 
    17     pj_int64_t  u6_addr64[2]; 
    18 #endif 
     7This is because {{{struct pj_in6_addr}}} is aligned to 8 bytes. 
    198 
    20 } pj_in6_addr; 
    21 }}} 
     9This causes failure in using SIP IPv6 UDP transport, with the following error: 
    2210 
     11 
     12  ''16:43:15.266    pjsua_acc.c  Unable to generate suitable Contact header for registration: Unsupported transport (PJSIP_EUNSUPTRANSPORT) [status=171060]'' 
     13 ''16:43:15.266    pjsua_acc.c  Unable to create registration: Unsupported transport (PJSIP_EUNSUPTRANSPORT) [status=171060]'' 
     14 
     15Thanks Simon Perreault for the report.