From e0a9fb65986a11a02177185f0ca1ab37eee6b325 Mon Sep 17 00:00:00 2001
From: Maxime Bizon <mbizon@freebox.fr>
Date: Mon, 28 Sep 2020 14:16:55 +0200
Subject: [PATCH] pjsua-lib: don't add hostname to random seed

pj_gethostip is blocking when local hostname cannot be resolved
through /etc/hosts and is called in the main thread from
pjsua_init/create()

remove it to allow pjsua initialisation to be non blocking
---
 pjsip/src/pjsua-lib/pjsua_core.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/pjsip/src/pjsua-lib/pjsua_core.c b/pjsip/src/pjsua-lib/pjsua_core.c
index 474a8d07c..eee362039 100644
--- a/pjsip/src/pjsua-lib/pjsua_core.c
+++ b/pjsip/src/pjsua-lib/pjsua_core.c
@@ -869,10 +869,6 @@ static void init_random_seed(void)
     hostname = pj_gethostname();
     seed = pj_hash_calc(seed, hostname->ptr, (int)hostname->slen);
 
-    /* Add primary IP address */
-    if (pj_gethostip(pj_AF_INET(), &addr)==PJ_SUCCESS)
-	seed = pj_hash_calc(seed, &addr.ipv4.sin_addr, 4);
-
     /* Get timeofday */
     pj_gettimeofday(&t);
     seed = pj_hash_calc(seed, &t, sizeof(t));
-- 
2.17.1

