[asterisk-dev] [Code Review] SIP URI comparison test (plus some bug fixes)

Olle E. Johansson oej at edvina.net
Wed Jul 21 04:50:37 CDT 2010


21 jul 2010 kl. 10.52 skrev Kaloyan Kovachev:

> On Wed, 21 Jul 2010 10:18:43 +0200, "Kevin P. Fleming"
> <kpfleming at digium.com> wrote:
>> On 07/21/2010 10:00 AM, Olle E. Johansson wrote:
>>> 
>>> 
>>> 
>>> While writing the bug report I forgot to mention that the string
>>> comparision of IP also affects IPv4.
>>> 
>>> 192.02.68.01 == 192.02.68.1
>>> 192.2.068.1 != 192.2.68.1
>>> 
>>> The zero prefix indicates that the group is written in octal
> notation...
>> 
>> Are you sure about that? The ABNF that Mark already posted shows that
>> each group is limited to three digits, and three digits is not adequate
>> to allow for the range 0-255 to be expressed on octal, only in decimal.
>> 
> 
> Hmmm 255 in octal is 377, so three digits should be enough

But you have to prefix it with a zero to make it octal in the notation, which ends up being four digits.

Kevin - I have no good answer for you. I know this has come up from time to time at SIPits, since the normal libraries used parse this as octal. That's propably one reason that the comparision has to be binary, but I see what you mean.

I'll try to check.

/O


More information about the asterisk-dev mailing list