#### Pre-Submission Checklist
- [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:
- [x] PR should be backported to stable branches
- [x] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
latest `make` version does not evaluate variables immediately. PR explicitly evaluates the LIBS makefile variable.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/4085
-- Commit Summary --
* app_python3: evaluate LIBS variable imediately in Makefile
-- File Changes --
M src/modules/app_python3/Makefile (4)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/4085.patchhttps://github.com/kamailio/kamailio/pull/4085.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/4085
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/4085(a)github.com>
#### Pre-Submission Checklist
- [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:
- [x] PR should be backported to stable branches
- [ ] Tested changes locally
- [x] Related to issue #4141
#### Description
<!-- Describe your changes in detail -->
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/4143
-- Commit Summary --
* secfilter: secf_check_dst function is dependant on order of items added to the list
-- File Changes --
M src/modules/secfilter/secfilter.c (2)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/4143.patchhttps://github.com/kamailio/kamailio/pull/4143.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/4143
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/4143(a)github.com>
If destinations is being added in `secfilter` starting with the lowest length, all other subsequent destinations with higher length are ignored.
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4141
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/4141(a)github.com>
<!-- 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
- [x] Related to issue #4141 (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
Fix problem with dst.len value
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/4142
-- Commit Summary --
* secfilter: fix secf_check_dst bug
-- File Changes --
M src/modules/secfilter/secfilter.c (1)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/4142.patchhttps://github.com/kamailio/kamailio/pull/4142.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/4142
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/4142(a)github.com>
Module: kamailio
Branch: master
Commit: c33f1f494f1e7ff9deb887f58644fb21934f9b0e
URL: https://github.com/kamailio/kamailio/commit/c33f1f494f1e7ff9deb887f58644fb2…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2025-02-07T07:44:45+01:00
core: ksrxrand - framework to set custom rand/srand functions
---
Added: src/core/rand/ksrxrand.c
Added: src/core/rand/ksrxrand.h
---
Diff: https://github.com/kamailio/kamailio/commit/c33f1f494f1e7ff9deb887f58644fb2…
Patch: https://github.com/kamailio/kamailio/commit/c33f1f494f1e7ff9deb887f58644fb2…
---
diff --git a/src/core/rand/ksrxrand.c b/src/core/rand/ksrxrand.c
new file mode 100644
index 00000000000..e0938cf47d5
--- /dev/null
+++ b/src/core/rand/ksrxrand.c
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2025 Daniel-Constantin Mierla (asipto.com)
+ *
+ * This file is part of Kamailio, a free SIP server.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <string.h>
+
+#include "../dprint.h"
+
+#include "fastrand.h"
+#include "ksrxrand.h"
+
+/**
+ * wrapper function for rand()/random()
+ */
+int ksr_wrand(void)
+{
+#if RAND_MAX < INT_MAX
+ return (int)random();
+#else
+ return rand();
+#endif
+}
+
+/**
+ * wrapper function for srand()/srandom()
+ */
+void ksr_wsrand(unsigned int seed)
+{
+#if RAND_MAX < INT_MAX
+ return srandom(seed);
+#else
+ return srand(seed);
+#endif
+}
+
+/**
+ * wrapper function for fastrand()
+ */
+int ksr_wfastrand(void)
+{
+ return (int)(fastrand() % ((unsigned)KSR_XRAND_MAX + 1));
+}
+
+/**
+ * global with internal RAND API
+ */
+ksr_xrand_t _ksr_xrand_api = {.xrand = ksr_wrand, .xsrand = ksr_wsrand};
+
+/**
+ *
+ */
+int ksr_xrand_set(char *name)
+{
+ if(strcmp(name, "fast") == 0) {
+ _ksr_xrand_api.xrand = ksr_wfastrand;
+ _ksr_xrand_api.xsrand = fastrand_seed;
+ return 0;
+ }
+ if((strcmp(name, "rand") == 0) || (strcmp(name, "rand") == 0)) {
+ /* default - nothing to do */
+ return 0;
+ }
+ LM_WARN("unknown rand engine: %s\n", name);
+ return -1;
+}
diff --git a/src/core/rand/ksrxrand.h b/src/core/rand/ksrxrand.h
new file mode 100644
index 00000000000..51f026e9bc6
--- /dev/null
+++ b/src/core/rand/ksrxrand.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2025 Daniel-Constantin Mierla (asipto.com)
+ *
+ * This file is part of Kamailio, a free SIP server.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef __KSRXRAND_H__
+#define __KSRXRAND_H__
+
+#include <limits.h>
+#include <stdlib.h>
+
+#if RAND_MAX < INT_MAX
+#define KSR_XRAND_MAX ((int)(0x7FFFFFFF)) /* (1<<31) - 1 */
+#else
+#define KSR_XRAND_MAX RAND_MAX
+#endif
+
+typedef int (*ksr_xrand_f)(void);
+typedef void (*ksr_xsrand_f)(unsigned int seed);
+
+typedef struct ksr_xrand
+{
+ ksr_xrand_f xrand;
+ ksr_xsrand_f xsrand;
+} ksr_xrand_t;
+
+extern ksr_xrand_t _ksr_xrand_api;
+
+#define ksr_xrand() _ksr_xrand_api.xrand()
+#define ksr_xsrand(s) _ksr_xrand_api.xsrand(s)
+
+int ksr_xrand_set(char *name);
+
+#endif
### Description
Let's assume we have a MO call from UE to P-CSCF that's over ipsec. Let's assume the picked ports are like UE(6101) -> P-CSCF(6100)
We have also set tcp_connection_lifetime to be 20 sec.
20 sec after INVITE connection is RST from Kamailio as expected.
Then ( > 20sec later) an INVITE response comes from B side, and must be delivered to the UE.
Kamailio opens a new connection and tries to establish a connection from 5060 (standard port)->6101 instead of 6100(P-CSCF) -> 6101(UE). IPSEC associations are not engaged and UE does not handle the request properly.
### Troubleshooting
#### Reproduction
#### Debugging Data
#### Log Messages
#### SIP Traffic
### Possible Solutions
The IPSEC module should re-open the tcp connection if it sees it's been dropped as core module has no awareness of IPSEC.
* **Operating System**:
All
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4138
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/4138(a)github.com>