Browse Source

gluon-core: only use a bridge for wired meshing when necessary

On most devices, there is only a single LAN interface connected to all LAN
ports, so no bridge is necessary.
Matthias Schiffer 6 years ago
parent
commit
2950cc3f59
1 changed files with 6 additions and 1 deletions
  1. 6 1
      package/gluon-core/luasrc/lib/gluon/upgrade/220-interface-lan

+ 6 - 1
package/gluon-core/luasrc/lib/gluon/upgrade/220-interface-lan

@@ -14,13 +14,18 @@ local old_proto = uci:get('network', 'mesh_lan', 'proto')
 
 uci:section('network', 'interface', 'mesh_lan', {
 	ifname        = sysconfig.lan_ifname,
-	type          = 'bridge',
 	igmp_snooping = false,
 	proto         = 'gluon_wired',
 	index         = 4,
 	legacy        = old_proto == 'gluon_mesh',
 })
 
+if sysconfig.lan_ifname:match(' ') then
+	uci:set('network', 'mesh_lan', 'type', 'bridge')
+else
+	uci:delete('network', 'mesh_lan', 'type')
+end
+
 local enable = site.mesh_on_lan(false)
 local old_auto = uci:get('network', 'mesh_lan', 'auto')
 local old_disabled = uci:get('network', 'mesh_lan', 'disabled')