#### 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: - [x] PR should be backported to stable branches - [x] Tested changes locally - [x] Related to issue #2060
#### Description Added parsing of IPv6 address in config file for DB URL. You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2061
-- Commit Summary --
* lib: database URL supports IPv6 address as hostname * db_mysql: database URL supports IPv6 address as hostname * db_postgres: database URL supports IPv6 address as hostname
-- File Changes --
M src/lib/srdb1/db_id.c (26) M src/modules/db_mysql/my_uri.c (26) M src/modules/db_postgres/pg_uri.c (26)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2061.patch https://github.com/kamailio/kamailio/pull/2061.diff
Hello, thank you for the pull request. This is indeed a good addition. I had a look to the code - I think it is good to combine this with a small refactoring in the modules as well.
As git master branch is currently frozen, I will put this on hold until 5.3 is released in a few weeks.
Not supporting IPv6 is a bug, Kamailio is supposed to work on IPv6 for its common use cases. Not sure why support in db_url was not discovered so far missing IPv6, we did a review couple of years ago, but we focused on SIP routing, this was somehow overlooked.
If the review of the code is ok, then this PR should be merged, unless many devs have something agains.
There is some code duplication, and I don't like it. But I don't know, may be it make sense, so I left it as it was.
Yes, we should support IPv6. But there are probably still a few places left like this. In the end most people will use DNS for internal names. I will merge it and do the refactoring then later.
Merged #2061 into master.