瀏覽代碼

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
Michael Furmur 5 月之前
父節點
當前提交
586802dbf0
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. 1 2
      src/modules/dispatcher/dispatch.c

+ 1 - 2
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;