Module: kamailio
Branch: master
Commit: 586802dbf0bc6a0e5fc50c4404fff1bda9a82add
URL: 
https://github.com/kamailio/kamailio/commit/586802dbf0bc6a0e5fc50c4404fff1bda9a82add

Author: Michael Furmur <fur...@pm.me>
Committer: Henning Westerholt <h...@gilawa.com>
Date: 2025-04-17T21:03:59+02:00

dispatcher: fix sock overwrite by ping_socket

fixes bug when 'ping_socket' for destination overwrites dp->sock
which is used for normal (not probing OPTIONS) requests

---

Modified: src/modules/dispatcher/dispatch.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/586802dbf0bc6a0e5fc50c4404fff1bda9a82add.diff
Patch: 
https://github.com/kamailio/kamailio/commit/586802dbf0bc6a0e5fc50c4404fff1bda9a82add.patch

---

diff --git a/src/modules/dispatcher/dispatch.c 
b/src/modules/dispatcher/dispatch.c
index 77c9dd92e20..a49e5638cd3 100644
--- a/src/modules/dispatcher/dispatch.c
+++ b/src/modules/dispatcher/dispatch.c
@@ -669,8 +669,7 @@ ds_dest_t *pack_dest(str iuri, int flags, int priority, str 
*attrs, int dload)
                        goto err;
                }
                STR_ZTOV(dp->attrs.ping_socket.s[dp->attrs.ping_socket.len], c);
-               dp->sock = grep_sock_info(&host, (unsigned short)port, proto);
-               if(dp->sock == 0) {
+               if(grep_sock_info(&host, (unsigned short)port, proto) == 0) {
                        LM_ERR("non-local socket <%.*s>\n", 
dp->attrs.ping_socket.len,
                                        dp->attrs.ping_socket.s);
                        goto err;

_______________________________________________
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to