[OpenSIPS/opensips] dee8a6: Script: Fix binary string comparisons

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[OpenSIPS/opensips] dee8a6: Script: Fix binary string comparisons

Răzvan Crainea-3
  Branch: refs/heads/master
  Home:   https://github.com/OpenSIPS/opensips
  Commit: dee8a6a37577a5aa1c1621ba66acebfe7f47e3f4
      https://github.com/OpenSIPS/opensips/commit/dee8a6a37577a5aa1c1621ba66acebfe7f47e3f4
  Author: Liviu Chircu <[hidden email]>
  Date:   2019-06-21 (Fri, 21 Jun 2019)

  Changed paths:
    M route.c
    M ut.h

  Log Message:
  -----------
  Script: Fix binary string comparisons

Addresses the following:

$var(ip_1_s) = "[2001:6c8:5e00:1::249]";
$var(ip_1_b) = $(var(ip_1_s){ip.pton}); # Save binary IP to variable
$var(ip_2_s) = "[2001:6c8:5e00:1::24a]";
$var(ip_2_b) = $(var(ip_2_s){ip.pton}); # Save binary IP to variable
if ($var(ip_1_b) == $var(ip_2_b)) {
    xlog("Variable saved Binary addresses are EQUAL");
} else {
    xlog("Variable saved Binary addresses are DIFFERENT");
}

Correct result: DIFFERENT.  Maybe this should be a unit test somehow.

Reported by @vasilevalex
Related to #1568



_______________________________________________
Devel mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel