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

msrp: fixed IPv6 address parsing #2472

Closed
wants to merge 3 commits into from

Conversation

sergey-safarov
Copy link
Member

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

Fix relaying MSRP messages to IPv6 uri.

@sergey-safarov sergey-safarov changed the title msrp: fixed IPv6 addrees parsing msrp: fixed IPv6 address parsing Sep 6, 2020
@miconda
Copy link
Member

miconda commented Sep 7, 2020

Can you explain where the problem actually happens? Because the patch does not seem right, being in the URI parser, making host shorter (skipping [ ]), but that is not correct, and can have other side effects. If routing is not working, then the fix has to be done in the routing part, not in the SIP uri host parsing.

@sergey-safarov
Copy link
Member Author

sergey-safarov commented Sep 7, 2020

The issue happens when Kamailio receive MSRP message like

MSRP e1df91d477cc632a SEND
To-Path: msrp://3.236.25.4:5060/s.57471.1.1260517458;tcp msrp://[2600:1f18:63e1:6937:c504:55a1:e141:6810]:2855/e3e5c58412a3479fb007238b3729403a;tcp
From-Path: msrp://192.168.122.2:2855/88fafa933e5144ffa59e;tcp
Message-ID: f7d1b51d7ec9ad2d
Byte-Range: 1-365/365
Success-Report: no
Failure-Report: no
Content-Type: message/cpim

From: +12134445566 <sip:+12134445566@example.com>
To: <sip:+13044598081@example.com>
DateTime: 2020-09-06T11:07:09.980093+03:00

MIME-Version: 1.0
Content-Type: application/im-iscomposing+xml

<?xml version='1.0' encoding='UTF-8'?>
<isComposing xmlns="urn:ietf:params:xml:ns:im-iscomposing"><state>active</state><contenttype>text</contenttype></isComposing>

Kamailio acts as MSRP relay between IPv4 and IPv6 clients.

Without fix kamailio as the host part use

[2600

And try nslookup hostname [2600.
And as port use

1f18:63e1:6937:c504:55a1:e141:6810]:2855

@sergey-safarov
Copy link
Member Author

I removed brackets striping and make tests - also work.

@miconda
Copy link
Member

miconda commented Sep 8, 2020

Thanks for the details. I will have to check the code and see if this patch covers it properly, somehow I am not confident in just jumping to ] for the case of ipv6 in the uri.

miconda added a commit that referenced this pull request Sep 9, 2020
- enclose ipv6 address in square brackets for msrp pv
- related to #2472
@miconda
Copy link
Member

miconda commented Sep 9, 2020

Can you test with commit 1cda029, I did a different approach to be sure there is [ at beginning of host part, not to find ] in uri parameters. The for the PV field, there is a function that already returns the ipv6 address with []. I haven't tested, thus feedback on how it works is appreciated in order to backport.

@sergey-safarov
Copy link
Member Author

I made test of 9645be commit (current master), now msrp messages properly parsed and relayed via IPv6.

@miconda
Copy link
Member

miconda commented Sep 11, 2020

Thanks! The commits can be backported. If you need them quickly, you can go ahead and backport, if not I will do it during the next days.

@miconda miconda closed this Sep 11, 2020
@sergey-safarov sergey-safarov deleted the msrp_v6 branch September 29, 2020 17:27
henningw pushed a commit that referenced this pull request Oct 2, 2020
- enclose ipv6 address in square brackets for msrp pv
- related to #2472

(cherry picked from commit 1cda029)
henningw pushed a commit that referenced this pull request Oct 2, 2020
- enclose ipv6 address in square brackets for msrp pv
- related to #2472

(cherry picked from commit 1cda029)
miconda added a commit that referenced this pull request Oct 12, 2020
- enclose ipv6 address in square brackets for msrp pv
- related to #2472

(cherry picked from commit 1cda029)
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

2 participants