diff --git a/LICENSE b/LICENSE index b5de67ef8..12115dfb9 100644 --- a/LICENSE +++ b/LICENSE @@ -10,7 +10,7 @@ Copyright (c) 2013 Dagorlad Copyright (c) 2006 Daniel S. Haischt Copyright (c) 2012 Darren Embry Copyright (c) 2005-2012 David Zeller -Copyright (c) 2014-2022 Deciso B.V. +Copyright (c) 2014-2023 Deciso B.V. Copyright (c) 2014 Electric Sheep Fencing, LLC Copyright (c) 2010 Erik Fonnesbeck Copyright (c) 2009 Erik Kristensen diff --git a/src/opnsense/mvc/app/library/OPNsense/Routing/Gateways.php b/src/opnsense/mvc/app/library/OPNsense/Routing/Gateways.php index 660f0808c..46e51f7eb 100644 --- a/src/opnsense/mvc/app/library/OPNsense/Routing/Gateways.php +++ b/src/opnsense/mvc/app/library/OPNsense/Routing/Gateways.php @@ -1,7 +1,7 @@ configHandle->ppps)) { + foreach ($this->configHandle->ppps->children() as $ppp) { + if ($realif == $ppp['if']) { + $ports = explode(',', $ppp->ports); + $realif = $this->getRealInterface($definedIntf, $ports[0]); + break; + } + } + } + break; + default: + break; + } + break; + default: + break; + } + } + + return $realif; + } + /** * return the type of the interface, for backwards compatibility * @param string $ipproto inet/inet6 type @@ -195,11 +254,8 @@ class Gateways // default address family $gw_arr['ipprotocol'] = 'inet'; } - // Make sure to use the tunnel interface for 6rd and 6to4 setups. - $ifname = $gw_arr["interface"]; - $ifcfg = $definedIntf[$ifname]; - $gw_arr["if"] = $gw_arr['ipprotocol'] == 'inet6' && in_array($ifcfg['ipaddrv6'] ?? null, ['6to4', '6rd']) ? "{$ifname}_stf" : $ifcfg['if']; - $gw_arr["attribute"] = $i++; + $gw_arr['if'] = $this->getRealInterface($definedIntf, $gw_arr['interface'], $gw_arr['ipprotocol']); + $gw_arr['attribute'] = $i++; if (Util::isIpAddress($gateway->gateway)) { if (empty($gw_arr['monitor_disable']) && empty($gw_arr['monitor'])) { $gw_arr['monitor'] = $gw_arr['gateway']; @@ -226,7 +282,7 @@ class Gateways foreach (["inet", "inet6"] as $ipproto) { // filename suffix and interface type as defined in the interface $descr = !empty($ifcfg['descr']) ? $ifcfg['descr'] : $ifname; - $realif = $ipproto == 'inet6' && in_array($ifcfg['ipaddrv6'] ?? null, ['6to4', '6rd']) ? "{$ifname}_stf" : $ifcfg['if']; + $realif = $this->getRealInterface($definedIntf, $ifname, $ipproto); $ctype = self::convertType($ipproto, $ifcfg); $ctype = $ctype != null ? $ctype : "GW"; // default configuration, when not set in gateway_item