From beabf7e7e3baeabd1dbb58c28d3fc14efd0d89f2 Mon Sep 17 00:00:00 2001 From: Luiz Souza Date: Tue, 24 Oct 2017 20:07:27 -0500 Subject: [PATCH] Fix a bug in interface_is_vlan(), only check QinQ interfaces when they exist. --- src/etc/inc/interfaces.inc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/etc/inc/interfaces.inc b/src/etc/inc/interfaces.inc index 34b9009a1b..fb9a487cbe 100644 --- a/src/etc/inc/interfaces.inc +++ b/src/etc/inc/interfaces.inc @@ -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);