mirror of
https://git.jami.net/savoirfairelinux/jami-daemon.git
synced 2025-08-07 22:02:12 +08:00
pjproject: add socktype and duplicate checking fix patch
https://github.com/pjsip/pjproject/issues/2787 https://github.com/pjsip/pjproject/pull/2788 Change-Id: I3c20c11a2a6f726dda6789fab2f12df2fcb23463
This commit is contained in:
@ -0,0 +1,37 @@
|
||||
From 2feee8db77ed47e7b574367295d4f03f9aea67f8 Mon Sep 17 00:00:00 2001
|
||||
From: sauwming <ming@teluu.com>
|
||||
Date: Fri, 6 Aug 2021 09:45:54 +0800
|
||||
Subject: [PATCH] Fix socktype and duplicate checking in pj_getaddrinfo()
|
||||
|
||||
---
|
||||
pjlib/src/pj/addr_resolv_sock.c | 11 ++++++++---
|
||||
1 file changed, 8 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/pjlib/src/pj/addr_resolv_sock.c b/pjlib/src/pj/addr_resolv_sock.c
|
||||
index f68c4b177..0954f2ee0 100644
|
||||
--- a/pjlib/src/pj/addr_resolv_sock.c
|
||||
+++ b/pjlib/src/pj/addr_resolv_sock.c
|
||||
@@ -197,15 +197,20 @@ PJ_DEF(pj_status_t) pj_getaddrinfo(int af, const pj_str_t *nodename,
|
||||
if (af!=PJ_AF_UNSPEC && res->ai_family != af)
|
||||
continue;
|
||||
|
||||
- if (res->ai_socktype != pj_SOCK_DGRAM()
|
||||
- && res->ai_socktype != pj_SOCK_STREAM()) {
|
||||
+ if (res->ai_socktype != pj_SOCK_DGRAM() &&
|
||||
+ res->ai_socktype != pj_SOCK_STREAM() &&
|
||||
+ /* It is possible that the result's sock type
|
||||
+ * is unspecified.
|
||||
+ */
|
||||
+ res->ai_socktype != 0)
|
||||
+ {
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Add current address in the resulting list if there
|
||||
* is no duplicates only. */
|
||||
for (j = 0; j < i; j++) {
|
||||
- if (!pj_memcmp(&ai[j].ai_addr, res->ai_addr, res->ai_addrlen)) {
|
||||
+ if (!pj_sockaddr_cmp(&ai[j].ai_addr, res->ai_addr)) {
|
||||
duplicate_found = PJ_TRUE;
|
||||
break;
|
||||
}
|
@ -18,6 +18,7 @@
|
||||
"0012-ignore-down-interfaces.patch",
|
||||
"0013-ignore-addresses-for-RFC7335.patch",
|
||||
"0014-fix-socket-leak.patch",
|
||||
"0015-fix-socktype-and-duplicate-checking.patch",
|
||||
"0001-win-config.patch",
|
||||
"0002-win-vs-gnutls.patch",
|
||||
"0003-win-vs2017-props.patch"
|
||||
|
@ -59,6 +59,7 @@ pjproject: pjproject-$(PJPROJECT_VERSION).tar.gz .sum-pjproject
|
||||
$(APPLY) $(SRC)/pjproject/0012-ignore-down-interfaces.patch # TODO remove with 2.12 (https://github.com/pjsip/pjproject/commit/997a468a5e90f9a88a36f543bef85e0fb0af0dfc)
|
||||
$(APPLY) $(SRC)/pjproject/0013-ignore-addresses-for-RFC7335.patch # TODO remove with 2.12 (https://github.com/pjsip/pjproject/commit/d245ffaf91120fab7bb70e3f46206faeb5b01269)
|
||||
$(APPLY) $(SRC)/pjproject/0014-fix-socket-leak.patch
|
||||
$(APPLY) $(SRC)/pjproject/0015-fix-socktype-and-duplicate-checking.patch # TODO remove with 2.12 (https://github.com/pjsip/pjproject/commits/2feee8db77ed47e7b574367295d4f03f9aea67f8)
|
||||
ifdef HAVE_ANDROID
|
||||
$(APPLY) $(SRC)/pjproject/0001-android.patch
|
||||
endif
|
||||
|
Reference in New Issue
Block a user