[pjsip] Problem binding socket in nat_detect.c

Nanang Izzuddin nanang at pjsip.org
Wed Jan 11 21:26:01 EST 2017


Hi Howard,

Just fixed this in SVN trunk at https://trac.pjsip.org/repos/changeset/5523.

Thank you for the report.

BR,
nanang


On Thu, Jan 5, 2017 at 11:36 PM, Howard Chalkley <hchalkley at frontier.co.uk>
wrote:

>
>
> I am upgrading our code to use v2.5.5 of the PJSIP library: we use it to
> handle communication with TURN servers, in the game “Elite:Dangerous”
>
>
>
> I found in unit testing after the upgrade that the call to detect the
> user’s NAT type was no longer working. The call in nat_detect.c to
> pj_sock_bind() was failing, returning a status code 130047
>
>
>
> I found that adding the following additional line, (near line 285) to
> preset the address family within the local_addr before the bind call, fixed
> the problem:
>
>
>
>     pj_bzero(&sess->local_addr, sizeof(pj_sockaddr));
>
>     addr_len = pj_sockaddr_get_len(server);
>
>     *sess**->**local_addr**.**addr**.**sa_family** = **server**->**addr*
> *.**sa_family**; **// added*
>
>     status = pj_sock_bind(sess->sock, &sess->local_addr, addr_len);
>
>     if (status != PJ_SUCCESS)
>
>        goto on_error;
>
>
>
> I’m running a Windows 64 build, using Visual Studio 15, running on Windows
> 10 Pro
>
>
>
>                 Howard Chalkley
>
>                 Frontier Developments
>
>                 www.frontier.co.uk
>
>
>
> _______________________________________________
> Visit our blog: http://blog.pjsip.org
>
> pjsip mailing list
> pjsip at lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20170112/aa5a0933/attachment-0002.html>


More information about the pjsip mailing list