Module: kamailio
Branch: master
Commit: 110200ce8e5c4cf7500e57e27a23f76e18044ad5
URL: https://github.com/kamailio/kamailio/commit/110200ce8e5c4cf7500e57e27a23f76…
Author: Federico Cabiddu <federico.cabiddu(a)gmail.com>
Committer: Henning Westerholt <hw(a)skalatan.de>
Date: 2021-10-21T17:26:44+02:00
core: tcp - add alias for cinfo dst IP
---
Modified: src/core/tcp_main.c
---
Diff: https://github.com/kamailio/kamailio/commit/110200ce8e5c4cf7500e57e27a23f76…
Patch: https://github.com/kamailio/kamailio/commit/110200ce8e5c4cf7500e57e27a23f76…
---
diff --git a/src/core/tcp_main.c b/src/core/tcp_main.c
index f8ff8dea45..d708ac63fe 100644
--- a/src/core/tcp_main.c
+++ b/src/core/tcp_main.c
@@ -1478,7 +1478,12 @@ inline static struct tcp_connection* tcpconn_add(struct tcp_connection *c)
* the second alias is for (peer_ip, peer_port, local_addr, 0) -- for
* finding any conenction to peer_ip, peer_port from local_addr
* the third alias is for (peer_ip, peer_port, local_addr, local_port)
- * -- for finding if a fully specified connection exists */
+ * -- for finding if a fully specified connection exists
+ * the fourth alias is for (peer_ip, peer_port, cinfo_addr, 0) -- for
+ * finding any connection to peer_ip, peer_port from address stored into cinfo (e.g. when proxy protocol is used)
+ * the fifth alias is for (peer_ip, peer_port, cinfo_addr, cinfo_port)
+ * -- for finding if a fully specified connection exists using address
+ * and port stored into cinfo*/
_tcpconn_add_alias_unsafe(c, c->rcv.src_port, &zero_ip, 0,
new_conn_alias_flags);
if (likely(c->rcv.dst_ip.af && ! ip_addr_any(&c->rcv.dst_ip))){
@@ -1487,6 +1492,14 @@ inline static struct tcp_connection* tcpconn_add(struct tcp_connection *c)
_tcpconn_add_alias_unsafe(c, c->rcv.src_port, &c->rcv.dst_ip,
c->rcv.dst_port, new_conn_alias_flags);
}
+ if (unlikely(c->cinfo.dst_ip.af && ! ip_addr_any(&c->cinfo.dst_ip) &&
+ ! ip_addr_cmp(&c->rcv.dst_ip, &c->cinfo.dst_ip))){
+ _tcpconn_add_alias_unsafe(c, c->rcv.src_port, &c->cinfo.dst_ip, 0,
+ new_conn_alias_flags);
+ _tcpconn_add_alias_unsafe(c, c->rcv.src_port, &c->cinfo.dst_ip, c->cinfo.dst_port,
+ new_conn_alias_flags);
+ }
+
/* ignore add_alias errors, there are some valid cases when one
* of the add_alias would fail (e.g. first add_alias for 2 connections
* with the same destination but different src. ip*/
@@ -1604,7 +1617,8 @@ struct tcp_connection* _tcpconn_find(int id, struct ip_addr* ip, int port,
((l_port==0) || (l_port==a->parent->rcv.dst_port)) &&
(ip_addr_cmp(ip, &a->parent->rcv.src_ip)) &&
(is_local_ip_any ||
- ip_addr_cmp(l_ip, &a->parent->rcv.dst_ip))
+ ip_addr_cmp(l_ip, &a->parent->rcv.dst_ip) ||
+ ip_addr_cmp(l_ip, &a->parent->cinfo.dst_ip))
) {
LM_DBG("found connection by peer address (id: %d)\n",
a->parent->id);
### Description
I have compiled Kamailio with `MEMPKG=sys` param and Google Sanitizers.
Then started/stopped Kamailio with default config.
After Kamailio stopped the produced report below.
```
==8042==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 15872 byte(s) in 124 object(s) allocated from:
#0 0x7f01775ed36f in __interceptor_malloc (/lib64/libasan.so.6+0xab36f)
#1 0x1296835 in addstr core/cfg.lex:1605
#2 0x129660e in addchar core/cfg.lex:1589
#3 0x1287356 in yylex core/cfg.lex:1266
#4 0x12be8c2 in yyparse core/cfg.tab.c:5508
#5 0x466c2d in main /tmp/kamailio/src/main.c:2487
#6 0x7f01768a91e1 in __libc_start_main (/lib64/libc.so.6+0x281e1)
Direct leak of 6784 byte(s) in 53 object(s) allocated from:
#0 0x7f01775ed36f in __interceptor_malloc (/lib64/libasan.so.6+0xab36f)
#1 0x1296835 in addstr core/cfg.lex:1605
#2 0x12894c7 in yylex core/cfg.lex:1395
#3 0x12be8c2 in yyparse core/cfg.tab.c:5508
#4 0x466c2d in main /tmp/kamailio/src/main.c:2487
#5 0x7f01768a91e1 in __libc_start_main (/lib64/libc.so.6+0x281e1)
Direct leak of 6104 byte(s) in 9 object(s) allocated from:
#0 0x7f01775ed36f in __interceptor_malloc (/lib64/libasan.so.6+0xab36f)
#1 0xbf1e09 in register_module core/sr_module.c:257
#2 0xc0c31c in load_module core/sr_module.c:641
#3 0x12d3b70 in yyparse core/cfg.y:1861
#4 0x466c2d in main /tmp/kamailio/src/main.c:2487
#5 0x7f01768a91e1 in __libc_start_main (/lib64/libc.so.6+0x281e1)
```
Full report [kamailio-sanitizer.log](https://github.com/kamailio/kamailio/files/7387628/…
### Additional Information
Compiled 1483ddb735c3fa3ea77b6e2d54ec67584e56e15b
--
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/2892
<!-- Kamailio Pull Request Template -->
<!--
IMPORTANT:
- for detailed contributing guidelines, read:
https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md
- pull requests must be done to master branch, unless they are backports
of fixes from master branch to a stable branch
- backports to stable branches must be done with 'git cherry-pick -x ...'
- code is contributed under BSD for core and main components (tm, sl, auth, tls)
- code is contributed GPLv2 or a compatible license for the other components
- GPL code is contributed with OpenSSL licensing exception
-->
#### Pre-Submission Checklist
<!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply -->
<!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above-->
<!-- If you're unsure about any of these, don't hesitate to ask on sr-dev mailing list -->
- [X] Commit message has the format required by CONTRIBUTING guide
- [X] Commits are split per component (core, individual modules, libs, utils, ...)
- [X] Each component has a single commit (if not, squash them into one commit)
- [X] No commits to README files for modules (changes must be done to docbook files
in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change
- [X] Small bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist:
<!-- Go over all points below, and after creating the PR, tick the checkboxes that apply -->
- [X] PR should be backported to stable branches
- [X] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
Currently re-registration is not happening in half of expire time. sometime its reaching near to expire time then sending re-registration. usually sip servers expect re-registration to happen in half of expire time.
<!-- Describe your changes in detail -->
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2765
-- Commit Summary --
* uac: registration refresh should in half time of expire
-- File Changes --
M src/modules/uac/uac_reg.c (2)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2765.patchhttps://github.com/kamailio/kamailio/pull/2765.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/2765
While troubleshooting a certificate issue we found it helpful to understand the port as well as the address for source and destination. I shortened source to src and destination to dst to avoid increasing the message output length also it's helpful for the two words to be equal length while reading... hope this is helpful to someone else...
<!-- Kamailio Pull Request Template -->
<!--
IMPORTANT:
- for detailed contributing guidelines, read:
https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md
- pull requests must be done to master branch, unless they are backports
of fixes from master branch to a stable branch
- backports to stable branches must be done with 'git cherry-pick -x ...'
- code is contributed under BSD for core and main components (tm, sl, auth, tls)
- code is contributed GPLv2 or a compatible license for the other components
- GPL code is contributed with OpenSSL licensing exception
-->
#### Pre-Submission Checklist
<!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply -->
<!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above-->
<!-- If you're unsure about any of these, don't hesitate to ask on sr-dev mailing list -->
- [ ] Commit message has the format required by CONTRIBUTING guide
- [ ] Commits are split per component (core, individual modules, libs, utils, ...)
- [ ] Each component has a single commit (if not, squash them into one commit)
- [ ] No commits to README files for modules (changes must be done to docbook files
in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change
- [ x] Small bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist:
<!-- Go over all points below, and after creating the PR, tick the checkboxes that apply -->
- [ ] PR should be backported to stable branches
- [x ] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
While troubleshooting a certificate issue we found it helpful to understand the port as well as the address for source and destination. I shortened source to src and destination to dst to avoid increasing the message output length also it's helpful for the two words to be equal length while reading... hope this is helpful to someone else...
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2872
-- Commit Summary --
* <a href="https://github.com/kamailio/kamailio/pull/2872/commits/f3bbed75ef2f5d793288…">Add ports for SSL_ERROR_SSL </a>
-- File Changes --
M src/modules/tls/tls_server.c (4)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2872.patchhttps://github.com/kamailio/kamailio/pull/2872.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/2872
<!-- Kamailio Pull Request Template -->
<!--
IMPORTANT:
- for detailed contributing guidelines, read:
https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md
- pull requests must be done to master branch, unless they are backports
of fixes from master branch to a stable branch
- backports to stable branches must be done with 'git cherry-pick -x ...'
- code is contributed under BSD for core and main components (tm, sl, auth, tls)
- code is contributed GPLv2 or a compatible license for the other components
- GPL code is contributed with OpenSSL licensing exception
-->
#### Pre-Submission Checklist
<!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply -->
<!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above-->
<!-- If you're unsure about any of these, don't hesitate to ask on sr-dev mailing list -->
- [X] Commit message has the format required by CONTRIBUTING guide
- [X] Commits are split per component (core, individual modules, libs, utils, ...)
- [X] Each component has a single commit (if not, squash them into one commit)
- [X] No commits to README files for modules (changes must be done to docbook files
in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change
- [ ] Small bug fix (non-breaking change which fixes an issue)
- [X] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist:
<!-- Go over all points below, and after creating the PR, tick the checkboxes that apply -->
- [ ] PR should be backported to stable branches
- [X] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
Do not recheck node later, if is disabled permanent. @rfuchs let me know what you think of this.
Thank you,
Stefan
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2886
-- Commit Summary --
* <a href="https://github.com/kamailio/kamailio/pull/2886/commits/04f30dce5f161ab3984c…">rtpengine: Don't recheck node if disabled permanently</a>
-- File Changes --
M src/modules/rtpengine/rtpengine.c (3)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2886.patchhttps://github.com/kamailio/kamailio/pull/2886.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/2886
Module: kamailio
Branch: master
Commit: 97f5f77f2d003a5e32e39aacf8182787a2c83a43
URL: https://github.com/kamailio/kamailio/commit/97f5f77f2d003a5e32e39aacf818278…
Author: Henning Westerholt <hw(a)skalatan.de>
Committer: Henning Westerholt <hw(a)skalatan.de>
Date: 2021-10-20T13:20:37Z
core: generalize some comment messages
---
Modified: src/core/sr_module.h
Modified: src/core/tcp_main.c
---
Diff: https://github.com/kamailio/kamailio/commit/97f5f77f2d003a5e32e39aacf818278…
Patch: https://github.com/kamailio/kamailio/commit/97f5f77f2d003a5e32e39aacf818278…
---
diff --git a/src/core/sr_module.h b/src/core/sr_module.h
index 99c1dc1de1..c9c482dfc1 100644
--- a/src/core/sr_module.h
+++ b/src/core/sr_module.h
@@ -138,7 +138,7 @@ typedef int (*param_func_t)( modparam_t type, void* val);
((fixup) ? (fixup)(param, param_no) : 0)
/* Macros - used as rank in child_init function */
-#define PROC_MAIN 0 /**< Main ser process */
+#define PROC_MAIN 0 /**< Main process */
#define PROC_TIMER -1 /**< Timer attendant process */
#define PROC_RPC -2 /**< RPC type process */
#define PROC_FIFO PROC_RPC /**< FIFO attendant process */
diff --git a/src/core/tcp_main.c b/src/core/tcp_main.c
index 3b46026027..f8ff8dea45 100644
--- a/src/core/tcp_main.c
+++ b/src/core/tcp_main.c
@@ -3717,9 +3717,9 @@ inline static int handle_tcp_child(struct tcp_child* tcp_c, int fd_i)
-/* handles io from a "generic" ser process (get fd or new_fd from a tcp_send)
+/* handles io from a "generic" process (get fd or new_fd from a tcp_send)
*
- * params: p - pointer in the ser processes array (pt[]), to the entry for
+ * params: p - pointer in the processes array (pt[]), to the entry for
* which an io event was detected
* fd_i - fd index in the fd_array (useful for optimizing
* io_watch_deletes)
@@ -4636,7 +4636,7 @@ static inline void tcp_timer_run(void)
/* keep in sync with tcpconn_destroy, the "delete" part should be
* the same except for io_watch_del..
- * Note: this function is called only on shutdown by the main ser process via
+ * Note: this function is called only on shutdown by the main process via
* cleanup(). However it's also safe to call it from the tcp_main process.
* => with the ser shutdown exception, it cannot execute in parallel
* with tcpconn_add() or tcpconn_destroy()*/
@@ -4750,7 +4750,7 @@ void tcp_main_loop()
}
}
#endif
- /* add all the unix sockets used for communcation with other ser processes
+ /* add all the unix sockets used for communcation with other processes
* (get fd, new connection a.s.o) */
for (r=1; r<process_no; r++){
if (pt[r].unix_sock>0) /* we can't have 0, we never close it!*/