Module: kamailio
Branch: 5.2
Commit: 4935d3c3c9ff76f34670fe39e26df11f909d6453
URL:
https://github.com/kamailio/kamailio/commit/4935d3c3c9ff76f34670fe39e26df11…
Author: Alex Balashov <abalashov(a)evaristesys.com>
Committer: Henning Westerholt <hw(a)skalatan.de>
Date: 2020-01-23T15:53:22+01:00
evapi: Removed cast of bind port to short, as this restricted ports to signed 16-bit int
values (< 32768).
htons() takes unsigned 16-bit integer and returns the same. When this value was cast to
(short), higher ports could not be used.
(cherry picked from commit e9545ae1e490ff768270d03ea28f14b751d2c132)
---
Modified: src/modules/evapi/evapi_dispatch.c
Modified: src/modules/evapi/evapi_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/4935d3c3c9ff76f34670fe39e26df11…
Patch:
https://github.com/kamailio/kamailio/commit/4935d3c3c9ff76f34670fe39e26df11…
---
diff --git a/src/modules/evapi/evapi_dispatch.c b/src/modules/evapi/evapi_dispatch.c
index b0e1e8386b..52e8f1d23e 100644
--- a/src/modules/evapi/evapi_dispatch.c
+++ b/src/modules/evapi/evapi_dispatch.c
@@ -676,7 +676,7 @@ int evapi_run_dispatcher(char *laddr, int lport)
bzero(&evapi_srv_addr, sizeof(evapi_srv_addr));
evapi_srv_addr.sin_family = h->h_addrtype;
- evapi_srv_addr.sin_port = htons((short)lport);
+ evapi_srv_addr.sin_port = htons(lport);
evapi_srv_addr.sin_addr = *(struct in_addr*)h->h_addr;
/* Set SO_REUSEADDR option on listening socket so that we don't
diff --git a/src/modules/evapi/evapi_mod.c b/src/modules/evapi/evapi_mod.c
index 7d3a4ecf36..e81cf08192 100644
--- a/src/modules/evapi/evapi_mod.c
+++ b/src/modules/evapi/evapi_mod.c
@@ -148,7 +148,7 @@ static int mod_init(void)
p = strchr(_evapi_bind_param, ':');
if(p!=NULL) {
*p++ = '\0';
- _evapi_bind_port = (short)atoi(p);
+ _evapi_bind_port = atoi(p);
if (_evapi_bind_port <= 0) {
LM_ERR("invalid port: %d\n", _evapi_bind_port);
return -1;