Module: kamailio
Branch: master
Commit: 55ddd80d15d1d915c85ec397b6ee100d24e6f077
URL: https://github.com/kamailio/kamailio/commit/55ddd80d15d1d915c85ec397b6ee100…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2025-07-15T11:54:27+02:00
nsb_redis: docs updated to turn server attributes in a list
---
Modified: src/modules/ndb_redis/doc/ndb_redis_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/55ddd80d15d1d915c85ec397b6ee100…
Patch: https://github.com/kamailio/kamailio/commit/55ddd80d15d1d915c85ec397b6ee100…
---
diff --git a/src/modules/ndb_redis/doc/ndb_redis_admin.xml b/src/modules/ndb_redis/doc/ndb_redis_admin.xml
index 85287118725..efcd95c9671 100644
--- a/src/modules/ndb_redis/doc/ndb_redis_admin.xml
+++ b/src/modules/ndb_redis/doc/ndb_redis_admin.xml
@@ -63,12 +63,49 @@
<title><varname>server</varname> (str)</title>
<para>
Specify the details to connect to REDIS server. It takes a list of attribute=value
- separated by semicolon, the attributes can be name, unix, addr, port, db, pass and tls. Name
- is a generic identifier to be used with module functions. unix is the path to the unix
- domain socket provided by redis server. addr and port are the IP address and the port to
- connect to REDIS server. pass is the server password. tls is to enable TLS connectivity.
- unix and (addr, port) are mutually exclusive. If both appear in same server settings unix
- domain socket is configured. db is the DB number to use (defaults to 0 if not specified).
+ separated by semicolon, the attributes can be:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ name - is a generic identifier to be used with module functions.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ unix - is the path to the unix domain socket to connect to REDIS server.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ addr - is the IP address to connect to REDIS server.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ port - is the port to connect to REDIS server.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ db - is the DB number to use (defaults to 0 if not specified).
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ pass - is the server password.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ tls - is to enable TLS connectivity.
+ </para>
+ </listitem>
+ </itemizedlist>
+
+ <para>
+ Thr unix and (addr, port) are mutually exclusive, if both appear in
+ same server settings unix domain socket is configured.
</para>
<para>
You can set this parameter many times, in case you want to connect to
@@ -76,8 +113,9 @@
server name when querying the REDIS instance.
</para>
<para>
- If tls is enabled, the module will validate the REDIS server certificate against the
- ca_path. There is currently no way to connect with a specified client certificate, the
+ If tls is enabled, the module will validate the REDIS server certificate
+ against the ca_path. There is currently no way to connect with
+ a specified client certificate, the
<ulink url="https://redis.io/docs/management/security/encryption/#client-certificate-au…">corresponding configuration</ulink>
to check client certificates in the REDIS server must therefore be turned off.
</para>
@@ -98,11 +136,12 @@ modparam("ndb_redis", "server", "name=srvY;addr=127.0.0.3;port=6379;db=5;pass=my
modparam("ndb_redis", "server", "name=srvY;unix=/tmp/redis.sock;db=3")
# sentinel (for a redis slave)
-modparam("ndb_redis", "server", "name=srvZ;sentinel_group=group_name;sentinel_master=0;sentinel=1.2.3.4:26379;sentinel=1.2.3.5:26379")
+modparam("ndb_redis", "server", "name=srvZ;sentinel_group=group_name;sentinel_master=0;"
+ "sentinel=1.2.3.4:26379;sentinel=1.2.3.5:26379")
# sentinel (for a redis master)
-modparam("ndb_redis", "server", "name=srvZ;sentinel_group=group_name;sentinel_master=1;sentinel=1.2.3.4:26379;sentinel=1.2.3.5:26379")
-
+modparam("ndb_redis", "server", "name=srvZ;sentinel_group=group_name;sentinel_master=1;"
+ "sentinel=1.2.3.4:26379;sentinel=1.2.3.5:26379")
...
</programlisting>
</example>
@@ -567,4 +606,3 @@ free reply data:
</section>
</section>
</chapter>
-
<!-- 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 -->
- [ ] 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 -->
This PR allows the functions `allow_address_group` and `allow_source_address_group` to search for Longest Prefix Match (LPM) when searching for an IP is in a subnet instead of the first found.
Since this is a stricter check, i don't think we require an extra param for it, but feel free to suggest otherwise if there are any use-cases that required the first matched.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/4297
-- Commit Summary --
* permissions: Perform LPM to find the longest matching subnet
-- File Changes --
M src/modules/permissions/hash.c (23)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/4297.patchhttps://github.com/kamailio/kamailio/pull/4297.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/4297
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/4297(a)github.com>
With gcc --version
```
$ gcc --version
gcc (GCC) 15.1.1 20250521 (Red Hat 15.1.1-2)
Copyright (C) 2025 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
```
this avoids a warning, that gcc is too old. Before:
```
$ rm src/config.mak
$ make config
make -C src/ config
make[1]: Entering directory '/git/voip/kamailio/src'
target architecture <x86_64>, host architecture <x86_64>
Makefile.defs:1065: You are using an old and unsupported gcc version (15.0+), compile at your own risk!
making config...
rm -f modules.lst
make --no-print-directory modules.lst
saving modules list...
make[1]: Leaving directory '/git/voip/kamailio/src'
```
after:
```
$ rm src/config.mak
$ make config
make -C src/ config
make[1]: Entering directory '/git/voip/kamailio/src'
target architecture <x86_64>, host architecture <x86_64>
making config...
rm -f modules.lst
make --no-print-directory modules.lst
saving modules list...
make[1]: Leaving directory '/git/voip/kamailio/src'
```
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/4318
-- Commit Summary --
* src/Makefile.defs: Avoid warning for gcc 15
-- File Changes --
M src/Makefile.defs (6)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/4318.patchhttps://github.com/kamailio/kamailio/pull/4318.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/4318
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/4318(a)github.com>
Module: kamailio
Branch: master
Commit: 68da5e0b1a8507efc03730e5c76d10079d5bc24d
URL: https://github.com/kamailio/kamailio/commit/68da5e0b1a8507efc03730e5c76d100…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2025-07-15T10:16:18+02:00
permissions: docs for subnet_match_mode param
- updated notes about subnet matching
---
Modified: src/modules/permissions/doc/permissions_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/68da5e0b1a8507efc03730e5c76d100…
Patch: https://github.com/kamailio/kamailio/commit/68da5e0b1a8507efc03730e5c76d100…
---
diff --git a/src/modules/permissions/doc/permissions_admin.xml b/src/modules/permissions/doc/permissions_admin.xml
index f893a3e4eb7..1e5e022902e 100644
--- a/src/modules/permissions/doc/permissions_admin.xml
+++ b/src/modules/permissions/doc/permissions_admin.xml
@@ -224,14 +224,16 @@
<note>
<para>
Starting with Kamailio version 6.1.x, the <function>allow_address()</function>
- function and its related functions use the Longest Prefix Match (LPM) method to
- find matching entries.
+ its related functions can do First Prefix Match (FPM) or the
+ Longest Prefix Match (LPM) methods to find the subnet matching record,
+ which can set the tag variable. The matching method is controled by
+ the parameter subnet_match_mode.
</para>
<para>
- This means the <function>_group</function> variants will now return the most specific
- (longest) subnet match, instead of the first match (which was previously the entry with
- the lowest group ID).
- This LPM behavior is now consistent across the following functions:
+ Th LPM means the <function>_group</function> variants will now return
+ the most specific (longest) subnet match, instead of the first match
+ (which was previously the entry with the lowest group ID).
+ The FPM/LPM behavior is now consistent across the following functions:
</para>
<itemizedlist>
<listitem><para><function>allow_address()</function></para></listitem>
@@ -842,6 +844,28 @@ modparam("permissions", "peer_tag_mode", 1)
...
modparam("permissions", "max_subnets", 1024)
...
+</programlisting>
+ </example>
+ </section>
+ <section id ="permissions.p.subnet_match_mode">
+ <title><varname>subnet_match_mode</varname> (int)</title>
+ <para>
+ Control how subnet addresses are matched: 0 - return on the first
+ prefix match; 1 - return on the longest prefix match. It impacts
+ functions like allow_source_address(), allow_address(),
+ allow_source_address_group() or allow_address_group().
+ </para>
+ <para>
+ <emphasis>
+ Default value is <quote>0</quote>.
+ </emphasis>
+ </para>
+ <example>
+ <title>Set <varname>subnet_match_mode</varname> parameter</title>
+ <programlisting format="linespecific">
+...
+modparam("permissions", "subnet_match_mode", 1)
+...
</programlisting>
</example>
</section>