Module: kamailio
Branch: master
Commit: e9545ae1e490ff768270d03ea28f14b751d2c132
URL:
https://github.com/kamailio/kamailio/commit/e9545ae1e490ff768270d03ea28f14b…
Author: Alex Balashov <abalashov(a)evaristesys.com>
Committer: Alex Balashov <abalashov(a)evaristesys.com>
Date: 2019-11-09T01:17:44-05: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.
---
Modified: src/modules/evapi/evapi_dispatch.c
Modified: src/modules/evapi/evapi_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/e9545ae1e490ff768270d03ea28f14b…
Patch:
https://github.com/kamailio/kamailio/commit/e9545ae1e490ff768270d03ea28f14b…
---
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 2275ed5af7..c0531bba2e 100644
--- a/src/modules/evapi/evapi_mod.c
+++ b/src/modules/evapi/evapi_mod.c
@@ -151,7 +151,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;