Changes between Initial Version and Version 1 of Ticket #1058
- Timestamp:
- Apr 26, 2010 7:03:56 AM (13 years ago)
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:1 On 64bit Linux: 2 2 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, 8 4 9 /* While these are used for proper alignment */ 10 pj_uint32_t u6_addr32[4]; 5 {{{sizeof(pj_sockaddr_in6)}}} is 32 bytes. 11 6 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 7 This is because {{{struct pj_in6_addr}}} is aligned to 8 bytes. 19 8 20 } pj_in6_addr; 21 }}} 9 This causes failure in using SIP IPv6 UDP transport, with the following error: 22 10 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 15 Thanks Simon Perreault for the report.