Ticket #1040 (closed defect: fixed)

Opened 9 years ago

Last modified 9 years ago

Problem with getting the default IP interface on FreeBSD due to wrong argument to connect() (thanks Roman Grachev for the patch)

Reported by: bennylp Owned by: bennylp
Priority: normal Milestone: release-1.6
Component: pjlib Version: trunk
Keywords: Cc:
Backport to 1.x milestone: Backported:

Description

Reported in this post:

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

Change History

comment:1 Changed 9 years ago by bennylp

  • Status changed from new to closed
  • Resolution set to fixed

Fixed in r3107

Note: See TracTickets for help on using tickets.