linphone-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Linphone-users] Bug: Invalid IPv6 address in SIP message parser (vi


From: jehan.monnier
Subject: Re: [Linphone-users] Bug: Invalid IPv6 address in SIP message parser (via attribute)
Date: Wed, 8 Apr 2020 15:44:09 +0200

Hi,

To  « be liberal in accepting a "received" parameter with or without the delimiting "[" and "] » tokens » the best solution is to modify the via_address rule (https://github.com/BelledonneCommunications/belle-sip/blob/35d16dce74163abbb134b9006066fed4f547625e/src/grammars/belle_sip_message.g#L1412to handle 3 cases: ipv4address | ipv6address  to follow the standard and ipv6reference to « be liberal » .

Dedicated test should be added in function test_via_header https://github.com/BelledonneCommunications/belle-sip/blob/35d16dce74163abbb134b9006066fed4f547625e/tester/belle_sip_headers_tester.c#L278

Best regards



Le 7 avr. 2020 à 14:32, Waishon <address@hidden> a écrit :

I just investigated the issue: Some providers tend to send the IPv6 address in the received parameter with square brackets some do not. Currently linphone only handles the event without having square brackets:
https://github.com/BelledonneCommunications/belle-sip/blob/master/src/grammars/belle_sip_message.g#L1933

The problem is described in this rfc information.
https://tools.ietf.org/html/rfc5118#section-4.5

LinPhone should handle both cases. A quick solution would be to add a "| ipv6reference" in line 1933. I just tested it and both SIP providers with or without brackets now works absolutely fine. However I don't know if we're allowed to use ipv6reference here, because it seems to be a function and not a simple grammar rule like ipv6address or ipv4address. Maybe someone can confirm if this would be a correct fix so that I can create a pull request.

Am Mo., 6. Apr. 2020 um 23:48 Uhr schrieb Waishon <address@hidden>:
Hey there,

I'm currently trying to connect to a SIP server using IPv6, which fails.

Linphone fails to decode the IPv6 address sent back in the Via header of the 401 Unauthorized reply (after first REGISTER request). The IPv6 is in the "URL encoded" format with squared brackets: [2000:abc::1]:5060. There seems to be an issue in the 
protocol definition where an IPv6 address isn't allowed to contain squared brackets.

Which is used here:

The following error is shown in the log when this parsing error occurrs:

2020-04-06 17:02:35:725 MESSAGE [org.antlr.runtime.MismatchedTokenException] reason [1342:1: via_params : ( via_received[$header_via::current] | generic_param[BELLE_SIP_PARAMETERS($header_via::current)] );]
2020-04-06 17:02:35:725 ERROR header_via parser error for [Via:SIP/2.0/UDP [2001:470:xxx:xxx::b56b]:5060;branch=z9hG4bK.XtPlwI23x;rport=5060;received=[2001:470:xxx:xxx::b56b]]
2020-04-06 17:02:35:726 MESSAGE channel [0x1b7a4f0] [563] bytes parsed
2020-04-06 17:02:35:727 ERROR channel [0x1b7a4f0]: no via in response.
2020-04-06 17:02:35:727 WARNING Response has no via.
2020-04-06 17:02:35:727 WARNING Discarding stateless response [401]
I'm using the latest flatpak version of Linphone on Ubuntu 19.10:
Desktop 4.1.1 - Qt5.9.0
Core 3.12.0

This bug is very annoying, because multiple SIP providers do support IPv6 and we would like to use the advantages of IPv6 SIP, so disabling IPv6 isn't an option :)

Thank you very much in advance.

Gruß
Sören
_______________________________________________
Linphone-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/linphone-users


reply via email to

[Prev in Thread] Current Thread [Next in Thread]