fix tls_mgm release domain issue#3629
Merged
liviuchircu merged 1 commit intoOpenSIPS:masterfrom Apr 17, 2025
36952362:master
Merged
fix tls_mgm release domain issue#3629liviuchircu merged 1 commit intoOpenSIPS:masterfrom 36952362:master
liviuchircu merged 1 commit intoOpenSIPS:masterfrom
36952362:master
Conversation
liviuchircu
approved these changes
Apr 16, 2025
Member
liviuchircu
left a comment
There was a problem hiding this comment.
LGTM and a very good catch!!
PS: An alternate fix would be to just i--; after the doms_array->size--;, but your approach is completely fine too.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes the issue where the contents in
client_dom_matchingorserver_dom_matchingare not fully released after executing thetls_reloadcommand.Details
Assuming the content of
tls_mgmconfig file which used bytls_mgmmodule as follows, where127.0.0.1and127.0.0.2are associated withdom1viamatch_sip_domain.After the
tls_mgmmodule has been loaded, thedom_filt_arrayinclient_dom_matchingis stored in the following format like:When performing the
tls_reloadoperation, it is necessary to calltls_free_db_domainsto release the old domain data, including the data inclient_dom_matching.reload_data -> tls_free_db_domains -> map_remove_tls_domHowever, during the loop iteration in
map_remove_tls_dom, the removal is incomplete. In the example mentioned above, the data associated with127.0.0.2would not be deleted. This can lead to an even worse situation — executingtls_reloadagain may cause OpenSIPS to crash.Solution
Adjust iteration logic in
map_remove_tls_domto make sure the data can be release completelyCompatibility
This is a change-specific and isolated in tls_mgm module - it's 100% retro-compatible with the other versions.
Closing issues