lib/interfaces, parse ifconfig tunnel data for https://github.com/opnsense/core/pull/2382

This commit is contained in:
Ad Schellevis 2018-05-05 10:01:24 +02:00
parent 62ed6633e4
commit 0ac2af1c1a

View File

@ -281,6 +281,12 @@ function legacy_interfaces_details($intf = null)
return $a['link-local'] - $b['link-local'];
});
}
} elseif (strpos($line, "\ttunnel ") !== false) {
// extract tunnel proto, source and destination
$result[$current_interface]["tunnel"] = array();
$result[$current_interface]["tunnel"]["proto"] = $line_parts[1];
$result[$current_interface]["tunnel"]["src_addr"] = $line_parts[2];
$result[$current_interface]["tunnel"]["dest_addr"] = $line_parts[4];
} elseif (preg_match("/media: (.*)/", $line, $matches)) {
// media, when link is between parenthesis grep only the link part
$result[$current_interface]['media'] = $matches[1];