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
|
||||
if model ? ports
|
||||
then
|
||||
lib.optionalAttrs (builtins.length wanTargets > 0) {
|
||||
"${builtins.head wanTargets}".ports = getPorts "wan";
|
||||
} // lib.optionalAttrs (ap ? lan-access) {
|
||||
"${ap.lan-access}".ports = getPorts "lan.*";
|
||||
if model.ports == [ {
|
||||
interface = "eth0";
|
||||
port = "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
|
||||
builtins.trace "No known ports for OpenWRT model ${ap.model}"
|
||||
{};
|
||||
|
|
Loading…
Reference in New Issue