Browse code

evapi: use port in getaddrinfo() otherwise it does not bind as expected

- regression added by cc098ecdfb556bf5efaab72fa767c773000f9fb6

Daniel-Constantin Mierla authored on 04/08/2020 13:19:39
Showing 1 changed files
... ...
@@ -650,7 +650,7 @@ int evapi_run_dispatcher(char *laddr, int lport)
650 650
 	memset(&ai_hints, 0, sizeof(struct addrinfo));
651 651
 	ai_hints.ai_family = AF_UNSPEC;		/* allow IPv4 or IPv6 */
652 652
 	ai_hints.ai_socktype = SOCK_STREAM;	/* stream socket */
653
-	ai_ret = getaddrinfo(laddr, NULL, &ai_hints, &ai_res);
653
+	ai_ret = getaddrinfo(laddr, int2str(lport, NULL), &ai_hints, &ai_res);
654 654
 	if (ai_ret != 0) {
655 655
 		LM_ERR("getaddrinfo failed: %d %s\n", ai_ret, gai_strerror(ai_ret));
656 656
 		return -1;