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

Liviu Chircu noreply at github.com
Fri Jun 21 08:16:19 EDT 2019


  Branch: refs/heads/master
  Home:   https://github.com/OpenSIPS/opensips
  Commit: dee8a6a37577a5aa1c1621ba66acebfe7f47e3f4
      https://github.com/OpenSIPS/opensips/commit/dee8a6a37577a5aa1c1621ba66acebfe7f47e3f4
  Author: Liviu Chircu <liviu at opensips.org>
  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





More information about the Devel mailing list