X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=applications%2Fluci-siitwizard%2Fluasrc%2Fmodel%2Fcbi%2Fsiitwizard.lua;h=c1dbb0efd38f9b10fbfb55e4c54cea9bc943f673;hp=7b6a0eb4a2313666d354be71204565254239645a;hb=71b8fd5ddf9d7f23ada97a1910bafd1f8711a76b;hpb=e9c934a5adb0692a86da9665fbcdfccf2285421b diff --git a/applications/luci-siitwizard/luasrc/model/cbi/siitwizard.lua b/applications/luci-siitwizard/luasrc/model/cbi/siitwizard.lua index 7b6a0eb4a..c1dbb0efd 100644 --- a/applications/luci-siitwizard/luasrc/model/cbi/siitwizard.lua +++ b/applications/luci-siitwizard/luasrc/model/cbi/siitwizard.lua @@ -45,7 +45,6 @@ local ipv4_netsz = uci:get("siit", "ipv4", "netsize") or "24" -- Find IPv4 allocation pool -- local gv4_net = luci.ip.IPv4(ipv4_pool) -local lan_net -- -- Generate ULA @@ -66,7 +65,7 @@ f = SimpleForm("siitwizward", "SIIT-Wizzard", f:field(DummyValue, "info_ula", "Mesh ULA address").value = ula:string() f:field(DummyValue, "ipv4_pool", "IPv4 allocation pool").value = - "%s (%i hosts)" %{ gv4_net:string(), 2 ^ gv4_net:prefix() - 2 } + "%s (%i hosts)" %{ gv4_net:string(), 2 ^ ( 32 - gv4_net:prefix() ) - 2 } f:field(DummyValue, "ipv4_size", "IPv4 LAN network prefix").value = "%i bit (%i hosts)" %{ ipv4_netsz, 2 ^ ( 32 - ipv4_netsz ) - 2 } @@ -162,6 +161,8 @@ function mode.write(self, section, value) uci:section("wireless", "wifi-iface", nil, { encryption = "none", mode = "adhoc", + txpower = 10, + sw_merge = 1, network = wifi_device, device = wifi_device, ssid = wifi_essid, @@ -363,7 +364,9 @@ function mode.write(self, section, value) -- lan dns uci:tset("dhcp", "lan", { - dhcp_option = "6," .. dns_server + dhcp_option = "6," .. dns_server, + start = bit.band(lan_net:minhost():add(1)[2][2], 0xFF), + limit = ( 2 ^ ( 32 - lan_net:prefix() ) ) - 3 }) -- hostname