Merge e8956e3f5a into e8866a04c5
				
					
				
			This commit is contained in:
		
						commit
						3c9d7fb590
					
				| @ -10,7 +10,7 @@ uci:section('network', 'interface', 'wan', | ||||
| 	      ifname = sysconfig.wan_ifname, | ||||
| 	      type = 'bridge', | ||||
| 	      igmp_snooping = 0, | ||||
| 	      peerdns = 0, | ||||
| 	      peerdns = 1, | ||||
| 	      auto = 1, | ||||
| 	    } | ||||
| ) | ||||
| @ -51,6 +51,15 @@ uci:section('network', 'route6', 'wan6_unreachable', | ||||
| 	    } | ||||
| ) | ||||
| 
 | ||||
| uci:section('network', 'interface', 'lan', | ||||
| 	    { | ||||
| 	      type = 'bridge', | ||||
| 	      proto = 'static', | ||||
| 	      ipaddr = '192.168.0.1', | ||||
| 	      netmask = '255.255.255.0', | ||||
| 	    } | ||||
| ) | ||||
| 
 | ||||
| uci:save('network') | ||||
| uci:commit('network') | ||||
| 
 | ||||
|  | ||||
| @ -88,9 +88,14 @@ o.default = uci:get_bool("network", "mesh_wan", "auto") and o.enabled or o.disab | ||||
| o.rmempty = false | ||||
| 
 | ||||
| if sysconfig.lan_ifname then | ||||
|   o = s:option(Flag, "mesh_lan", translate("Enable meshing on the LAN interface")) | ||||
|   o.default = uci:get_bool("network", "mesh_lan", "auto") and o.enabled or o.disabled | ||||
|   o.rmempty = false | ||||
|   o = s:option(ListValue, "lan_option", translate("LAN interface")) | ||||
|   o:value("client", translate("Client network")) | ||||
|   o:value("mesh", translate("Mesh network")) | ||||
|   -- TODO: o:value("bridge", translate("Private network (Bridged)")) | ||||
|   o:value("nat", translate("Private network (NAT)")) | ||||
|   o.default = (uci:get_bool("network", "mesh_lan", "auto") and "mesh") or | ||||
|     (uci.get("network", "lan", "ifname") == sysconfig.lan_ifname and "nat") or | ||||
|     "client" | ||||
| end | ||||
| 
 | ||||
| 
 | ||||
| @ -119,12 +124,22 @@ function f.handle(self, state, data) | ||||
|     uci:set("network", "mesh_wan", "auto", data.mesh_wan) | ||||
| 
 | ||||
|     if sysconfig.lan_ifname then | ||||
|       uci:set("network", "mesh_lan", "auto", data.mesh_lan) | ||||
| 
 | ||||
|       if data.mesh_lan == '1' then | ||||
|         uci:set("network", "client", "ifname", "bat0") | ||||
|       else | ||||
|       if data.lan_option == 'client' then | ||||
|         uci:set("network", "client", "ifname", sysconfig.lan_ifname .. " bat0") | ||||
|       else | ||||
|         uci:set("network", "client", "ifname", "bat0") | ||||
|       end | ||||
| 
 | ||||
|       if data.lan_option == 'nat' then | ||||
|         uci:set("network", "lan", "ifname", sysconfig.lan_ifname) | ||||
|       else | ||||
|         uci:set("network", "lan", "ifname", '') | ||||
|       end | ||||
| 
 | ||||
|       if data.lan_option == 'mesh' then | ||||
|         uci:set("network", "mesh_lan", "auto", '1') | ||||
|       else | ||||
|         uci:set("network", "mesh_lan", "auto", '0') | ||||
|       end | ||||
|     end | ||||
| 
 | ||||
|  | ||||
| @ -29,6 +29,10 @@ o:depends("enabled", '1') | ||||
| o.datatype = "wpakey" | ||||
| o.default = uci:get(config, primary_iface, "key") | ||||
| 
 | ||||
| o = s:option(Flag, "nat", translate("Use NAT")) | ||||
| o:depends("enabled", '1') | ||||
| o.default = uci:get(config, primary_iface, "network") == "lan" and o.enabled or o.disabled | ||||
| 
 | ||||
| function f.handle(self, state, data) | ||||
|   if state == FORM_VALID then | ||||
|     uci:foreach(config, "wifi-device", | ||||
| @ -41,7 +45,7 @@ function f.handle(self, state, data) | ||||
|           uci:section(config, "wifi-iface", name, | ||||
|                       { | ||||
|                         device     = device, | ||||
|                         network    = "wan", | ||||
|                         network    = data.nat == '1' and "lan" or "wan", | ||||
|                         mode       = 'ap', | ||||
|                         encryption = 'psk2', | ||||
|                         ssid       = data.ssid, | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user