Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rtpengine: remove square brackets from IPv6 address for getaddrinfo #2685

Merged
merged 1 commit into from Mar 22, 2021
Merged

Conversation

Den4t
Copy link
Contributor

@Den4t Den4t commented Mar 21, 2021

rtpengine: IPv6 address in square brackets interpreted as FQDN.

  • After loading from DB, rn_address is in form: [x:x:x:x:x:x:x:x]:nnnn, getaddrinfo function expect ipv6 in node argument without square brackets, otherwise, the argument is interpreted as FQDN.

Pre-Submission Checklist

  • Commit message has the format required by CONTRIBUTING guide
  • Commits are split per component (core, individual modules, libs, utils, ...)
  • Each component has a single commit (if not, squash them into one commit)
  • 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

  • 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:

  • PR should be backported to stable branches
  • Tested changes locally
  • Related to issue #XXXX (replace XXXX with an open issue number)

Description

…unction

- After loading from DB rn_address is in form: [x:x:x:x:x:x:x:x]:nnnn, getaddrinfo function expect ipv6 in node argument without square brackets, otherwise, the argument is interpreted as FQDN.
@miconda
Copy link
Member

miconda commented Mar 22, 2021

@Den4t: have you checked that setting 0 in place of ] is not having other side effects? I didn't notice any restore.

@rfuchs: any opinion on this patch?

@Den4t
Copy link
Contributor Author

Den4t commented Mar 22, 2021

@miconda

have you checked that setting 0 in place of ] is not having other side effects? I didn't notice any restore.

Yes, hp - is a pointer to pkg_malloc-ed hostname variable, this var is freed right after getaddrinfo and not used any more.
I tested this patch localy, work as expected.

@rfuchs
Copy link
Member

rfuchs commented Mar 22, 2021

@Den4t: have you checked that setting 0 in place of ] is not having other side effects? I didn't notice any restore.

@rfuchs: any opinion on this patch?

Looks good to me

@miconda
Copy link
Member

miconda commented Mar 22, 2021

Thanks, merging it!

@miconda miconda merged commit 491d126 into kamailio:master Mar 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants