<!--
Kamailio Project uses GitHub Issues only for bugs in the code or feature requests. Please use this template only for bug reports.
If you have questions about using Kamailio or related to its configuration file, ask on sr-users mailing list:
* https://lists.kamailio.org/mailman3/postorius/lists/sr-users.lists.kamailio…
If you have questions about developing extensions to Kamailio or its existing C code, ask on sr-dev mailing list:
* https://lists.kamailio.org/mailman3/postorius/lists/sr-dev.lists.kamailio.o…
Please try to fill this template as much as possible for any issue. It helps the developers to troubleshoot the issue.
Note that an issue report may be closed automatically after about 2 months
if there is no interest from developers or community users on pursuing it, being
considered expired. In such case, it can be reopened by writing a comment that includes
the token `/notexpired`. About two weeks before considered expired, the issue is
marked with the label `stale`, trying to notify the submitter and everyone else
that might be interested in it. To remove the label `stale`, write a comment that
includes the token `/notstale`. Also, any comment postpone the `expire` timeline,
being considered that there is interest in pursuing the issue.
If there is no content to be filled in a section, the entire section can be removed.
You can delete the comments from the template sections when filling.
You can delete next line and everything above before submitting (it is a comment).
-->
### Description
When starting Kam inside a docker container and the `auto_bind_ipv6` option is enabled, kam fails to start, see below for error logs.
Instead, inside the very same container, by executing it from a shell, it works. The difference is that starting from the entrypoint kam has pid 1, while starting from a shell as a different pid.
### Troubleshooting
#### Reproduction
Start kamailio inside a docker container,with network=host and the `auto_bind_ipv6` option enabled.
#### Log Messages
<!--
Check the syslog file and if there are relevant log messages printed by Kamailio, add them next, or attach to issue, or provide a link to download them (e.g., to a pastebin site).
-->
```
2025-01-02T15:58:29.655278523Z 0(1) DEBUG: <core> [core/socket_info.c:1764]: add_interfaces(): If: lo Fam: 2 Flg: 10049 Adr: 127.0.0.1
2025-01-02T15:58:29.655282371Z 0(1) DEBUG: <core> [core/socket_info.c:1764]: add_interfaces(): If: eth0 Fam: 2 Flg: 11043 Adr: 188.34.182.80
2025-01-02T15:58:29.655286664Z 0(1) DEBUG: <core> [core/socket_info.c:1764]: add_interfaces(): If: docker0 Fam: 2 Flg: 1003 Adr: 172.17.0.1
2025-01-02T15:58:29.655290864Z 0(1) DEBUG: <core> [core/socket_info.c:1764]: add_interfaces(): If: br-1653739d678f Fam: 2 Flg: 11043 Adr: 172.18.0.1
2025-01-02T15:58:29.655295002Z 0(1) DEBUG: <core> [core/socket_info.c:1764]: add_interfaces(): If: br-kamnet Fam: 2 Flg: 11043 Adr: 172.23.42.1
2025-01-02T15:58:29.655299578Z 0(1) ERROR: <core> [core/socket_info.c:1349]: nl_bound_sock(): could not bind NETLINK sock to sockaddr_nl
2025-01-02T15:58:29.655303602Z 0(1) ERROR: <core> [core/socket_info.c:1666]: add_interfaces_via_netlink(): Could not get network interface list
2025-01-02T15:58:29.655482917Z 0(1) ERROR: <core> [core/socket_info.c:1789]: fix_hostname(): could not resolve 'matteo-ord-devel'
2025-01-02T15:58:29.655515080Z 0(1) ERROR: <core> [core/socket_info.c:2392]: fix_all_socket_lists(): fix_socket_list udp failed
2025-01-02T15:58:29.655519918Z failed to initialize list addresses
```
### Possible Solutions
I think that it boils down to the function [nl_bound_sock](https://github.com/kamailio/kamailio/blob/master/src/core/so… function, which sets the netlink struct Port ID with `getpid()` ( https://github.com/kamailio/kamailio/blob/master/src/core/socket_info.c#L13… ).
For some reason this does not work when kam is forking from pid 1.
According to [man 7 netlink](https://man7.org/linux/man-pages/man7/netlink.7.html) should be safe to set that pid to 0, and let the kernel assign one, since if assigned from the process, it must guarantee that is unique if when multiple sockets are requested.
I've tried to set that port id to `0` and works correctly:
```diff
diff --git a/src/core/socket_info.c b/src/core/socket_info.c
index 2557a83b1e..662a3741c2 100644
--- a/src/core/socket_info.c
+++ b/src/core/socket_info.c
@@ -1343,7 +1343,7 @@ static int nl_bound_sock(void)
bzero(&la, sizeof(la));
la.nl_family = AF_NETLINK;
la.nl_pad = 0;
- la.nl_pid = getpid();
+ la.nl_pid = 0;
la.nl_groups = 0;
if(bind(sock, (struct sockaddr *)&la, sizeof(la)) < 0) {
LM_ERR("could not bind NETLINK sock to sockaddr_nl\n");
```
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
5.8.4
* **Operating System**:
<!--
Details about the operating system, the type: Linux (e.g.,: Debian 8.4, Ubuntu 16.04, CentOS 7.1, ...), MacOS, xBSD, Solaris, ...;
Kernel details (output of `lsb_release -a` and `uname -a`)
-->
Docker container based on ubuntu noble.
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4094
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/4094(a)github.com>
Creating an empty file `src/modules/topos_htable/README` allows the installation to complete without errors.
```
$ ninja install
[..]
CMake Error at src/modules/cmake_install.cmake:1588 (file):
file INSTALL cannot find
"/usr/src/kamailio/src/modules/topos_htable/README":
No such file or directory.
Call Stack (most recent call first):
src/cmake_install.cmake:96 (include)
cmake_install.cmake:47 (include)
FAILED: CMakeFiles/install.util
cd /usr/src/kamailio/build && /usr/bin/cmake -P cmake_install.cmake
ninja: build stopped: subcommand failed.
$ touch ../src/modules/topos_htable/README && ninja install && echo $?
[..]
0
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4095
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/4095(a)github.com>
Module: kamailio
Branch: master
Commit: fc182198c7182759cc2c10b4afa3569336a438c9
URL: https://github.com/kamailio/kamailio/commit/fc182198c7182759cc2c10b4afa3569…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2025-01-03T12:02:21+01:00
presence_dfks: added README file
- initial import, it is going to be autmatically generated from now on
---
Added: src/modules/presence_dfks/README
---
Diff: https://github.com/kamailio/kamailio/commit/fc182198c7182759cc2c10b4afa3569…
Patch: https://github.com/kamailio/kamailio/commit/fc182198c7182759cc2c10b4afa3569…
---
diff --git a/src/modules/presence_dfks/README b/src/modules/presence_dfks/README
new file mode 100644
index 00000000000..d965a6e4c6a
--- /dev/null
+++ b/src/modules/presence_dfks/README
@@ -0,0 +1,78 @@
+presence_dfks Module
+
+Maja Stanislawska
+
+ <maja.stanislawska(a)yahoo.com>
+
+Victor Seva
+
+ Sipwise GmbH
+ <vseva(a)sipwise.com>
+
+Edited by
+
+Victor Seva
+
+ Sipwise GmbH
+ <vseva(a)sipwise.com>
+
+ Copyright �� 2014 Maja Stanislawska
+
+ Copyright �� 2024 Victor Seva
+ __________________________________________________________________
+
+ Table of Contents
+
+ 1. Admin Guide
+
+ 1. Overview
+ 2. Dependencies
+
+ 2.1. Kamailio Modules
+ 2.2. External Libraries or Applications
+
+ 3. Parameters
+
+Chapter 1. Admin Guide
+
+ Table of Contents
+
+ 1. Overview
+ 2. Dependencies
+
+ 2.1. Kamailio Modules
+ 2.2. External Libraries or Applications
+
+ 3. Parameters
+
+1. Overview
+
+ This module for handling as-feature-event presence messages Provides
+ support for 'Device FeatureKey Synchronization', as described in
+ http://community.polycom.com/polycom/attachments/polycom/VoIP/2233/1/De
+ viceFeatureKeySynchronizationFD.pdf This 'protocol' was developed at
+ Broadsoft, and is used in Linksys/Cisco and Polycom phones and probably
+ some other too. It allows to set up features like dnd (No Not Disturb)
+ and call forwarding using phone interface and have that status updated
+ on aplication server/ proxy or otherway, set those features on
+ aplication server using some gui, and have this data provisioned on
+ phone. For Shared Line Appreance application this let You share status
+ on all phones.
+
+2. Dependencies
+
+ 2.1. Kamailio Modules
+ 2.2. External Libraries or Applications
+
+2.1. Kamailio Modules
+
+ The following modules must be loaded before this module:
+ * sl. presence. pua.
+
+2.2. External Libraries or Applications
+
+ The following libraries or applications must be installed before
+ running Kamailio with this module loaded:
+ * libxml2 - xml handling library.
+
+3. Parameters