Revision 171c8315
src/etc/inc/gwlb.inc | ||
---|---|---|
1071 | 1071 |
continue 3; |
1072 | 1072 |
} |
1073 | 1073 |
$ovpnid = substr($ifcfg['if'], 5); |
1074 |
$found = false; |
|
1074 | 1075 |
foreach (config_get_path("openvpn/{$ovpntype}", []) as $ovpnconf) { |
1075 | 1076 |
if (empty($ovpnconf)) { |
1076 | 1077 |
continue; |
1077 | 1078 |
} |
1078 | 1079 |
if ($ovpnconf['vpnid'] == $ovpnid) { |
1080 |
$found = true; |
|
1079 | 1081 |
// skip IPv6-only interfaces |
1080 | 1082 |
if ($ovpnconf['create_gw'] == "v6only") { |
1081 | 1083 |
continue 3; |
... | ... | |
1086 | 1088 |
} |
1087 | 1089 |
} |
1088 | 1090 |
} |
1091 |
if (!$found) { |
|
1092 |
// skip unexpected interfaces, e.g. QinQ such as ovpns6.600.601 |
|
1093 |
continue 2; |
|
1094 |
} |
|
1089 | 1095 |
$ctype = "VPNv4"; |
1090 | 1096 |
} elseif (substr($ifcfg['if'], 0, 5) == "ipsec") { |
1091 | 1097 |
$ikeid = substr($ifcfg['if'], 5); |
... | ... | |
1216 | 1222 |
continue 3; |
1217 | 1223 |
} |
1218 | 1224 |
$ovpnid = substr($ifcfg['if'], 5); |
1225 |
$found = false; |
|
1219 | 1226 |
foreach (config_get_path("openvpn/{$ovpntype}", []) as $ovpnconf) { |
1220 | 1227 |
if (empty($ovpnconf)) { |
1221 | 1228 |
continue; |
1222 | 1229 |
} |
1223 | 1230 |
if ($ovpnconf['vpnid'] == $ovpnid) { |
1231 |
$found = true; |
|
1224 | 1232 |
// skip IPv4-only interfaces |
1225 | 1233 |
if ($ovpnconf['create_gw'] == "v4only") { |
1226 | 1234 |
continue 3; |
... | ... | |
1231 | 1239 |
} |
1232 | 1240 |
} |
1233 | 1241 |
} |
1242 |
if (!$found) { |
|
1243 |
// skip unexpected interfaces, e.g. QinQ such as ovpns6.600.601 |
|
1244 |
continue 2; |
|
1245 |
} |
|
1234 | 1246 |
$ctype = "VPNv6"; |
1235 | 1247 |
} elseif (substr($ifcfg['if'], 0, 5) == "ipsec") { |
1236 | 1248 |
$ikeid = substr($ifcfg['if'], 5); |
Also available in: Unified diff
Correct OpenVPN QinQ creation. Fix #15692
Also avoid creating bogus dynamic gateways for QinQ interfaces.