forked from zentralwerk/network
lib/config/legacy: treat single eth0 as wan port
This commit is contained in:
parent
e975d78504
commit
7834d64e27
|
@ -443,11 +443,23 @@ in
|
||||||
in
|
in
|
||||||
if model ? ports
|
if model ? ports
|
||||||
then
|
then
|
||||||
lib.optionalAttrs (builtins.length wanTargets > 0) {
|
if model.ports == [ {
|
||||||
"${builtins.head wanTargets}".ports = getPorts "wan";
|
interface = "eth0";
|
||||||
} // lib.optionalAttrs (ap ? lan-access) {
|
port = "lan";
|
||||||
"${ap.lan-access}".ports = getPorts "lan.*";
|
type = "phys";
|
||||||
|
} ] && builtins.length wanTargets > 0
|
||||||
|
then {
|
||||||
|
# Only 1 Ethernet port, treat as uplink
|
||||||
|
"${builtins.head wanTargets}".ports = [ "eth0" ];
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
lib.optionalAttrs (builtins.length wanTargets > 0) {
|
||||||
|
"${builtins.head wanTargets}".ports = getPorts "wan";
|
||||||
|
} // lib.optionalAttrs (ap ? lan-access) {
|
||||||
|
"${ap.lan-access}".ports = self.lib.unique (
|
||||||
|
getPorts "lan.*"
|
||||||
|
);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
builtins.trace "No known ports for OpenWRT model ${ap.model}"
|
builtins.trace "No known ports for OpenWRT model ${ap.model}"
|
||||||
{};
|
{};
|
||||||
|
|
Loading…
Reference in New Issue