BUG: fix bird ASNs from invalid string value to valid integer value
This commit is contained in:
parent
df0e9c1d59
commit
7e8927f375
|
@ -119,6 +119,13 @@ function writeRoutinatorExceptionFile ($roas)
|
|||
|
||||
function writeExportJSON ($roas)
|
||||
{
|
||||
$n = 0;
|
||||
foreach ($roas['roas'] as $object)
|
||||
{
|
||||
$roas['roas'][$n]['asn'] = "AS" . $roas['roas'][$n]['asn'];
|
||||
$n++;
|
||||
}
|
||||
|
||||
$json = json_encode($roas, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT);
|
||||
|
||||
$fp = fopen ('roa/export_dn42.json', 'w');
|
||||
|
|
|
@ -97,7 +97,7 @@ foreach ($raw_array as $sub_array)
|
|||
// Extract ASxxxxx from string.
|
||||
preg_match ("/AS[0-9]+/", explode (":", $asn)[1], $_asn);
|
||||
|
||||
$roas["roas"][$k]["asn"] = $_asn[0];
|
||||
$roas["roas"][$k]["asn"] = trim ($_asn[0], "AS");
|
||||
$roas["roas"][$k]["prefix"] = $_prefix;
|
||||
$roas["roas"][$k]["maxLength"] = ($_asn[0] != "AS0" ? $_maxlength : MAX_LEN_IPV6_AS0);
|
||||
$roas["roas"][$k]["ta"] = $_ta;
|
||||
|
@ -187,7 +187,7 @@ foreach ($raw_array as $sub_array)
|
|||
// Extract ASxxxxx from string.
|
||||
preg_match ("/AS[0-9]+/", explode (":", $asn)[1], $_asn);
|
||||
|
||||
$roas["roas"][$k]["asn"] = $_asn[0];
|
||||
$roas["roas"][$k]["asn"] = trim ($_asn[0], "AS");
|
||||
$roas["roas"][$k]["prefix"] = $_prefix;
|
||||
$roas["roas"][$k]["maxLength"] = ($_asn[0] != "AS0" ? $_maxlength : MAX_LEN_IPV4_AS0);
|
||||
$roas["roas"][$k]["ta"] = $_ta;
|
||||
|
|
Loading…
Reference in a new issue