<p>Joshua Colp <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/9780">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Richard Mudgett: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, approved; Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">pjproject_bundled: Fix for Solaris builds. Do not undef s_addr.<br><br>The authors of PJProject undef s_addr because of some issue in Microsoft<br>Windows. However in Oracle Solaris, s_addr is not a structure member, but<br>defined to map to the real structure member.<br><br>Updates the patch from ASTERISK_20366<br><br>ASTERISK-27997<br><br>Change-Id: I8223026d4d54e2a46521085fcc94bfa6ebe35b11<br>---<br>M res/res_pjsip/pjsip_resolver.c<br>A third-party/pjproject/patches/0000-solaris.patch<br>2 files changed, 150 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/res_pjsip/pjsip_resolver.c b/res/res_pjsip/pjsip_resolver.c</span><br><span>index bc53990..b2e70f4 100644</span><br><span>--- a/res/res_pjsip/pjsip_resolver.c</span><br><span>+++ b/res/res_pjsip/pjsip_resolver.c</span><br><span>@@ -327,7 +327,7 @@</span><br><span> resolve->addresses.entry[address_count].addr_len = sizeof(pj_sockaddr_in);</span><br><span> pj_sockaddr_init(pj_AF_INET(), &resolve->addresses.entry[address_count].addr, NULL,</span><br><span> target->port);</span><br><span style="color: hsl(0, 100%, 40%);">- resolve->addresses.entry[address_count].addr.ipv4.sin_addr = *(struct pj_in_addr*)ast_dns_record_get_data(record);</span><br><span style="color: hsl(120, 100%, 40%);">+ resolve->addresses.entry[address_count].addr.ipv4.sin_addr = *(pj_in_addr *) ast_dns_record_get_data(record);</span><br><span> } else {</span><br><span> ast_debug(2, "[%p] AAAA record received on target '%s'\n", resolve, ast_dns_query_get_name(query));</span><br><span> resolve->addresses.entry[address_count].addr_len = sizeof(pj_sockaddr_in6);</span><br><span>diff --git a/third-party/pjproject/patches/0000-solaris.patch b/third-party/pjproject/patches/0000-solaris.patch</span><br><span>new file mode 100644</span><br><span>index 0000000..0790627</span><br><span>--- /dev/null</span><br><span>+++ b/third-party/pjproject/patches/0000-solaris.patch</span><br><span>@@ -0,0 +1,149 @@</span><br><span style="color: hsl(120, 100%, 40%);">+From 8f8a9dc7203bfcd5557ad5c2f15359308535c4bb Mon Sep 17 00:00:00 2001</span><br><span style="color: hsl(120, 100%, 40%);">+From: Shaun Ruffell <sruffell@digium.com></span><br><span style="color: hsl(120, 100%, 40%);">+Date: Fri, 7 Sep 2012 14:31:19 -0500</span><br><span style="color: hsl(120, 100%, 40%);">+Subject: [PATCH] pjproject: Fix for Solaris builds. Do not undef s_addr.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+pjproject, in order to solve build problems on Windows [1], undefines s_addr in</span><br><span style="color: hsl(120, 100%, 40%);">+one of it's headers that is included in res_rtp_asterisk.c. On Solaris s_addr is</span><br><span style="color: hsl(120, 100%, 40%);">+not a structure member, but defined to map to the real strucuture member,</span><br><span style="color: hsl(120, 100%, 40%);">+therefore when building on Solaris it's possible to get build errors like:</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ [CC] res_rtp_asterisk.c -> res_rtp_asterisk.o</span><br><span style="color: hsl(120, 100%, 40%);">+ In file included from /export/home/admin/asterisk-11-svn/include/asterisk/stun.h:29,</span><br><span style="color: hsl(120, 100%, 40%);">+ from res_rtp_asterisk.c:51:</span><br><span style="color: hsl(120, 100%, 40%);">+ /export/home/admin/asterisk-11-svn/include/asterisk/network.h: In function `inaddrcmp':</span><br><span style="color: hsl(120, 100%, 40%);">+ /export/home/admin/asterisk-11-svn/include/asterisk/network.h:92: error: structure has no member named `s_addr'</span><br><span style="color: hsl(120, 100%, 40%);">+ /export/home/admin/asterisk-11-svn/include/asterisk/network.h:92: error: structure has no member named `s_addr'</span><br><span style="color: hsl(120, 100%, 40%);">+ res_rtp_asterisk.c: In function `ast_rtp_on_ice_tx_pkt':</span><br><span style="color: hsl(120, 100%, 40%);">+ res_rtp_asterisk.c:706: warning: dereferencing type-punned pointer will break strict-aliasing rules</span><br><span style="color: hsl(120, 100%, 40%);">+ res_rtp_asterisk.c:710: warning: dereferencing type-punned pointer will break strict-aliasing rules</span><br><span style="color: hsl(120, 100%, 40%);">+ res_rtp_asterisk.c: In function `rtp_add_candidates_to_ice':</span><br><span style="color: hsl(120, 100%, 40%);">+ res_rtp_asterisk.c:1085: error: structure has no member named `s_addr'</span><br><span style="color: hsl(120, 100%, 40%);">+ make[2]: *** [res_rtp_asterisk.o] Error 1</span><br><span style="color: hsl(120, 100%, 40%);">+ make[1]: *** [res] Error 2</span><br><span style="color: hsl(120, 100%, 40%);">+ make[1]: Leaving directory `/export/home/admin/asterisk-11-svn'</span><br><span style="color: hsl(120, 100%, 40%);">+ gmake: *** [_cleantest_all] Error 2</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+Unfortunately, in order to make this work, I also had to make sure pjproject</span><br><span style="color: hsl(120, 100%, 40%);">+only used the typdef pj_in_addr and not the struct pj_in_addr so that when</span><br><span style="color: hsl(120, 100%, 40%);">+building Asterisk I could "typedef struct in_addr pj_in_addr". It's possible</span><br><span style="color: hsl(120, 100%, 40%);">+then that the library and users of those interfaces in Asterisk have a different</span><br><span style="color: hsl(120, 100%, 40%);">+idea about the type of the argument. While on the surface it looks like they are</span><br><span style="color: hsl(120, 100%, 40%);">+all 32 bit big endian values.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+[1] http://trac.pjsip.org/repos/changeset/484</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+Reported-by: Ben Klang</span><br><span style="color: hsl(120, 100%, 40%);">+(issues ASTERISK-20366)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+Updated by ASTERISK-27997</span><br><span style="color: hsl(120, 100%, 40%);">+---</span><br><span style="color: hsl(120, 100%, 40%);">+ pjlib/include/pj/sock.h | 8 +++++++-</span><br><span style="color: hsl(120, 100%, 40%);">+ pjlib/src/pj/sock_bsd.c | 2 +-</span><br><span style="color: hsl(120, 100%, 40%);">+ pjlib/src/pj/sock_linux_kernel.c | 2 +-</span><br><span style="color: hsl(120, 100%, 40%);">+ pjlib/src/pj/sock_symbian.cpp | 2 +-</span><br><span style="color: hsl(120, 100%, 40%);">+ pjlib/src/pj/sock_uwp.cpp | 2 +-</span><br><span style="color: hsl(120, 100%, 40%);">+ pjsip/src/test/transport_test.c | 2 +-</span><br><span style="color: hsl(120, 100%, 40%);">+ 6 files changed, 12 insertions(+), 6 deletions(-)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+diff --git a/pjlib/include/pj/sock.h b/pjlib/include/pj/sock.h</span><br><span style="color: hsl(120, 100%, 40%);">+index 8fc833c..c415358 100644</span><br><span style="color: hsl(120, 100%, 40%);">+--- a/pjlib/include/pj/sock.h</span><br><span>++++ b/pjlib/include/pj/sock.h</span><br><span style="color: hsl(120, 100%, 40%);">+@@ -484,6 +484,7 @@ typedef enum pj_socket_sd_type</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+ #define PJ_INVALID_SOCKET (-1)</span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">++#ifndef _ASTERISK_H</span><br><span style="color: hsl(120, 100%, 40%);">+ /* Must undefine s_addr because of pj_in_addr below */</span><br><span style="color: hsl(120, 100%, 40%);">+ #undef s_addr</span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+@@ -495,6 +496,11 @@ typedef struct pj_in_addr</span><br><span style="color: hsl(120, 100%, 40%);">+ pj_uint32_t s_addr; /**< The 32bit IP address. */</span><br><span style="color: hsl(120, 100%, 40%);">+ } pj_in_addr;</span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">++#else</span><br><span style="color: hsl(120, 100%, 40%);">++#include <sys/types.h></span><br><span style="color: hsl(120, 100%, 40%);">++#include <netinet/in.h></span><br><span style="color: hsl(120, 100%, 40%);">++typedef struct in_addr pj_in_addr;</span><br><span style="color: hsl(120, 100%, 40%);">++#endif</span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+ /**</span><br><span style="color: hsl(120, 100%, 40%);">+ * Maximum length of text representation of an IPv4 address.</span><br><span style="color: hsl(120, 100%, 40%);">+@@ -714,7 +720,7 @@ PJ_DECL(char*) pj_inet_ntoa(pj_in_addr inaddr);</span><br><span style="color: hsl(120, 100%, 40%);">+ *</span><br><span style="color: hsl(120, 100%, 40%);">+ * @return nonzero if the address is valid, zero if not.</span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+-PJ_DECL(int) pj_inet_aton(const pj_str_t *cp, struct pj_in_addr *inp);</span><br><span style="color: hsl(120, 100%, 40%);">++PJ_DECL(int) pj_inet_aton(const pj_str_t *cp, pj_in_addr *inp);</span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+ /**</span><br><span style="color: hsl(120, 100%, 40%);">+ * This function converts an address in its standard text presentation form</span><br><span style="color: hsl(120, 100%, 40%);">+diff --git a/pjlib/src/pj/sock_bsd.c b/pjlib/src/pj/sock_bsd.c</span><br><span style="color: hsl(120, 100%, 40%);">+index 95c3804..daefc54 100644</span><br><span style="color: hsl(120, 100%, 40%);">+--- a/pjlib/src/pj/sock_bsd.c</span><br><span>++++ b/pjlib/src/pj/sock_bsd.c</span><br><span style="color: hsl(120, 100%, 40%);">+@@ -244,7 +244,7 @@ PJ_DEF(char*) pj_inet_ntoa(pj_in_addr inaddr)</span><br><span style="color: hsl(120, 100%, 40%);">+ * numbers-and-dots notation into binary data and stores it in the structure</span><br><span style="color: hsl(120, 100%, 40%);">+ * that inp points to. </span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+-PJ_DEF(int) pj_inet_aton(const pj_str_t *cp, struct pj_in_addr *inp)</span><br><span style="color: hsl(120, 100%, 40%);">++PJ_DEF(int) pj_inet_aton(const pj_str_t *cp, pj_in_addr *inp)</span><br><span style="color: hsl(120, 100%, 40%);">+ {</span><br><span style="color: hsl(120, 100%, 40%);">+ char tempaddr[PJ_INET_ADDRSTRLEN];</span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+diff --git a/pjlib/src/pj/sock_linux_kernel.c b/pjlib/src/pj/sock_linux_kernel.c</span><br><span style="color: hsl(120, 100%, 40%);">+index 899b486..10d84cd 100644</span><br><span style="color: hsl(120, 100%, 40%);">+--- a/pjlib/src/pj/sock_linux_kernel.c</span><br><span>++++ b/pjlib/src/pj/sock_linux_kernel.c</span><br><span style="color: hsl(120, 100%, 40%);">+@@ -149,7 +149,7 @@ PJ_DEF(char*) pj_inet_ntoa(pj_in_addr in)</span><br><span style="color: hsl(120, 100%, 40%);">+ * numbers-and-dots notation into binary data and stores it in the structure</span><br><span style="color: hsl(120, 100%, 40%);">+ * that inp points to. </span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+-PJ_DEF(int) pj_inet_aton(const pj_str_t *ccp, struct pj_in_addr *addr)</span><br><span style="color: hsl(120, 100%, 40%);">++PJ_DEF(int) pj_inet_aton(const pj_str_t *ccp, pj_in_addr *addr)</span><br><span style="color: hsl(120, 100%, 40%);">+ {</span><br><span style="color: hsl(120, 100%, 40%);">+ pj_uint32_t val;</span><br><span style="color: hsl(120, 100%, 40%);">+ int base, n;</span><br><span style="color: hsl(120, 100%, 40%);">+diff --git a/pjlib/src/pj/sock_symbian.cpp b/pjlib/src/pj/sock_symbian.cpp</span><br><span style="color: hsl(120, 100%, 40%);">+index 09239b0..e72bbda 100644</span><br><span style="color: hsl(120, 100%, 40%);">+--- a/pjlib/src/pj/sock_symbian.cpp</span><br><span>++++ b/pjlib/src/pj/sock_symbian.cpp</span><br><span style="color: hsl(120, 100%, 40%);">+@@ -299,7 +299,7 @@ PJ_DEF(char*) pj_inet_ntoa(pj_in_addr inaddr)</span><br><span style="color: hsl(120, 100%, 40%);">+ * numbers-and-dots notation into binary data and stores it in the structure</span><br><span style="color: hsl(120, 100%, 40%);">+ * that inp points to. </span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+-PJ_DEF(int) pj_inet_aton(const pj_str_t *cp, struct pj_in_addr *inp)</span><br><span style="color: hsl(120, 100%, 40%);">++PJ_DEF(int) pj_inet_aton(const pj_str_t *cp, pj_in_addr *inp)</span><br><span style="color: hsl(120, 100%, 40%);">+ {</span><br><span style="color: hsl(120, 100%, 40%);">+ enum { MAXIPLEN = PJ_INET_ADDRSTRLEN };</span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+diff --git a/pjlib/src/pj/sock_uwp.cpp b/pjlib/src/pj/sock_uwp.cpp</span><br><span style="color: hsl(120, 100%, 40%);">+index 876c328..40250bf 100644</span><br><span style="color: hsl(120, 100%, 40%);">+--- a/pjlib/src/pj/sock_uwp.cpp</span><br><span>++++ b/pjlib/src/pj/sock_uwp.cpp</span><br><span style="color: hsl(120, 100%, 40%);">+@@ -933,7 +933,7 @@ PJ_DEF(char*) pj_inet_ntoa(pj_in_addr inaddr)</span><br><span style="color: hsl(120, 100%, 40%);">+ * numbers-and-dots notation into binary data and stores it in the structure</span><br><span style="color: hsl(120, 100%, 40%);">+ * that inp points to. </span><br><span style="color: hsl(120, 100%, 40%);">+ */</span><br><span style="color: hsl(120, 100%, 40%);">+-PJ_DEF(int) pj_inet_aton(const pj_str_t *cp, struct pj_in_addr *inp)</span><br><span style="color: hsl(120, 100%, 40%);">++PJ_DEF(int) pj_inet_aton(const pj_str_t *cp, pj_in_addr *inp)</span><br><span style="color: hsl(120, 100%, 40%);">+ {</span><br><span style="color: hsl(120, 100%, 40%);">+ char tempaddr[PJ_INET_ADDRSTRLEN];</span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+diff --git a/pjsip/src/test/transport_test.c b/pjsip/src/test/transport_test.c</span><br><span style="color: hsl(120, 100%, 40%);">+index e5083d1..c429cc7 100644</span><br><span style="color: hsl(120, 100%, 40%);">+--- a/pjsip/src/test/transport_test.c</span><br><span>++++ b/pjsip/src/test/transport_test.c</span><br><span style="color: hsl(120, 100%, 40%);">+@@ -35,7 +35,7 @@ int generic_transport_test(pjsip_transport *tp)</span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+ /* Check that local address name is valid. */</span><br><span style="color: hsl(120, 100%, 40%);">+ {</span><br><span style="color: hsl(120, 100%, 40%);">+- struct pj_in_addr addr;</span><br><span style="color: hsl(120, 100%, 40%);">++ pj_in_addr addr;</span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+ if (pj_inet_pton(pj_AF_INET(), &tp->local_name.host,</span><br><span style="color: hsl(120, 100%, 40%);">+ &addr) == PJ_SUCCESS)</span><br><span style="color: hsl(120, 100%, 40%);">+-- </span><br><span style="color: hsl(120, 100%, 40%);">+2.7.4</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/9780">change 9780</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/9780"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 15 </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I8223026d4d54e2a46521085fcc94bfa6ebe35b11 </div>
<div style="display:none"> Gerrit-Change-Number: 9780 </div>
<div style="display:none"> Gerrit-PatchSet: 4 </div>
<div style="display:none"> Gerrit-Owner: Alexander Traud <pabstraud@compuserve.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>