Fix a bug in interface_is_vlan(), only check QinQ interfaces when they exist.

This commit is contained in:
Luiz Souza 2017-10-24 20:07:27 -05:00
parent 9875c1999b
commit beabf7e7e3

View File

@ -304,7 +304,12 @@ function interface_is_vlan($if = NULL) {
return ($vlan);
}
}
/* Check for the first level tag in QinQ interfaces. */
if (!isset($config['qinqs']['qinqentry']) ||
!is_array($config['qinqs']['qinqentry'])) {
return (NULL);
}
foreach ($config['qinqs']['qinqentry'] as $qinqidx => $qinq) {
if ($if == $qinq['vlanif']) {
return ($qinq);