[pjsip] [pjlib] Wrong socket length on FreeBSD

Roman Grachev roman.grachev at gmail.com
Mon Feb 22 10:41:26 CST 2010


Hi,

There is a problem with getting default ip interface on FreeBSD: in
function pj_getdefaultipinterface() the socket length passed to
pj_sock_connect() seems to be incorrect (although in works fine on
Windows, Linux and Max, I checked). The following patch fixes the
problem:

Index: trunk/softphone/contrib/pj/pjlib/src/pj/sock_common.c
===================================================================
--- a/trunk/softphone/contrib/pj/pjlib/src/pj/sock_common.c
+++ b/trunk/softphone/contrib/pj/pjlib/src/pj/sock_common.c

@@ -915,5 +915,5 @@
     }

-    status = pj_sock_connect(fd, &a, sizeof(a));
+    status = pj_sock_connect(fd, &a, pj_sockaddr_get_len(&a));
     if (status != PJ_SUCCESS) {
         pj_sock_close(fd);

Roman Grachev

P.S. I am duplicating this message because the last one never made it
to the list



More information about the pjsip mailing list