A simple change, which allows to check, if a coming request matches
not only by an IP address and a transport protocol,
but also using the source port of a request.
Improvements are done for the following functions of the lcr module:
- from_any_gw()
- from_gw()
Back compatibility provided, hence it does not affect already existing behavior.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2832
-- Commit Summary --
* lcr: source port check for from_any_gw() and from_gw().
-- File Changes --
M src/modules/lcr/doc/lcr_admin.xml (31)
M src/modules/lcr/lcr_mod.c (116)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2832.patchhttps://github.com/kamailio/kamailio/pull/2832.diff
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/2832
Module: kamailio
Branch: master
Commit: 536736f2529f7554929f3aa6b74ac616c382bc6e
URL: https://github.com/kamailio/kamailio/commit/536736f2529f7554929f3aa6b74ac61…
Author: Donat Zenichev <dzenichev(a)sipwise.com>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2021-08-25T09:28:38+02:00
lcr: remove excessive checks for the 'src_port' accuracy
Remove unneeded check for 'src_port' in:
- ki_from_any_gw_addr()
- ki_from_gw_addr()
Which makes no sense because 'src_port' is of type 'unsigned int',
and the check concerns whether it's less than 0 or not.
---
Modified: src/modules/lcr/lcr_mod.c
---
Diff: https://github.com/kamailio/kamailio/commit/536736f2529f7554929f3aa6b74ac61…
Patch: https://github.com/kamailio/kamailio/commit/536736f2529f7554929f3aa6b74ac61…
---
diff --git a/src/modules/lcr/lcr_mod.c b/src/modules/lcr/lcr_mod.c
index 858352f2c7..57b4021ac9 100644
--- a/src/modules/lcr/lcr_mod.c
+++ b/src/modules/lcr/lcr_mod.c
@@ -3093,9 +3093,9 @@ static int ki_from_gw_addr(
return -1;
}
- /* src_port set to 0 means we don't want to check it */
- if((src_port < 0) || (src_port > 65535)) {
- LM_ERR("invalid port parameter value %d\n", transport);
+ /* src_port set to 0 is allowed and means we don't want to check it */
+ if(src_port > 65535) {
+ LM_ERR("invalid port parameter value %d\n", src_port);
return -1;
}
@@ -3215,9 +3215,9 @@ static int ki_from_any_gw_addr(sip_msg_t *_m, str *addr_str, int transport, unsi
return -1;
}
- /* src_port set to 0 means we don't want to check it */
- if((src_port < 0) || (src_port > 65535)) {
- LM_ERR("invalid port parameter value %d\n", transport);
+ /* src_port set to 0 is allowed and means we don't want to check it */
+ if(src_port > 65535) {
+ LM_ERR("invalid port parameter value %d\n", src_port);
return -1;
}
Module: kamailio
Branch: master
Commit: 9115d74b33aefb0febad7c7fffe7d184e4066b77
URL: https://github.com/kamailio/kamailio/commit/9115d74b33aefb0febad7c7fffe7d18…
Author: Donat Zenichev <dzenichev(a)sipwise.com>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2021-08-25T09:28:38+02:00
lcr: source port check for from_any_gw() and from_gw().
A simple change, which allows to check, if a coming request matches
not only by an IP address and a transport protocol,
but also using the source port of a request.
Improvements are done for the following functions of the lcr module:
- from_any_gw()
- from_gw()
Back compatibility provided, hence it does not affect already existing behavior.
---
Modified: src/modules/lcr/doc/lcr_admin.xml
Modified: src/modules/lcr/lcr_mod.c
---
Diff: https://github.com/kamailio/kamailio/commit/9115d74b33aefb0febad7c7fffe7d18…
Patch: https://github.com/kamailio/kamailio/commit/9115d74b33aefb0febad7c7fffe7d18…
Hello,
I am considering to release Kamailio v5.5.2 sometime next week, likely
on Wednesday (August 25, 2021). This is the usual heads up
notification to see if anyone is aware of issues not yet reported to bug
tracker and if yes, do it as soon as possible to give them a chance to
be fixed.
Cheers,
Daniel
--
Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- www.linkedin.com/in/miconda
Hi Kamailians!
I’ve written a very short IETF draft in order to register a SIP TLS ALPN:
https://datatracker.ietf.org/doc/draft-johansson-sip-alpn/
An ALPN is a short code used in TLS connection setup to inform the server of the “next protocol” after TLS connection is setup. This way, a server listening to a port, like 5061 and 443, can support multiple protocols on the same port.
In Kamailio, we support HTTP 1 and SIP because they’re very much alike, but if there’s a need to support other protocols it will be hard, like MSRP. With ALPN support we could when using TLS.
In addition, newer versions of HTTP will be harder to support using the same parser. ALPN makes it easier.
I do hope the registration will come through. If so, maybe we can discuss what’s needed to support ALPN for SIP and HTTP in the TLS code.
Cheers,
/O
In advance of the 5.5.2 release, note that for full IPv6 addresses with proto, brackets, and a full 5-digit port, the `varchar(50)` is too small to hold the information in `fromip` and `toip`. Also, it appears (at least for PostgreSQL) that Kamailio stores to the `message` column as `bytea`, rather than text, so perhaps that should be reflected in the table setup scripts.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2831