This reverts commit 6bcdc18d65.
Since the bug where a write operation is executed when the input
matches the default has been fixed in form.js, this workaround
is no longer needed and is being reverted.
Signed-off-by: Andy Chiang <AndyChiang_git@outlook.com>
In handleJoinConfirm(), when the scanned BSS has no VHT/HT info,
uci.remove('wireless', radioDev.getName(), 'htmode') is called
intending to remove only the htmode option. However, uci.remove()
only accepts (conf, sid) and silently ignores the third parameter,
causing the entire wifi-device section to be deleted from the
rpcd session delta.
This makes the radio disappear from the Wireless Overview page
until the session delta is cleared.
Fix by using uci.unset() which correctly handles three parameters
(conf, sid, opt) to remove a single option.
Signed-off-by: Weicheng Xiao <weicheng.xiao@outlook.com>
dnsmasq behaviour changed slightly and MACs separated
by hyphen are no longer accepted. Accept only colon
separator when validating. Also enforce hex doublets,
i.e. 00 instead of 0.
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
After the ES2016 rework, a very old bug was reverted where the WiFi SSID was
treated as raw HTML and directly appended to DOM.
This might result in XSS vulnerability with specially crafted SSID from the
Access Point around.
This is only triggered on opening the modal as the normal wireless.js view
doesn't scan the Access Point.
To fix this and make it more clear that SSID must be always escaped, move the
SSID handling to a dedicated variable and use the document.createTextNode()
to escape it similar to how it's done in similar place like the
channel_analysis.js
Fixes: cdce600aae ("luci-mod-network: give wireless.js ES2016 treatment and refactor")
Reported-by: Sasha Romijn <sct@mxsasha.eu>
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
The Kernel receives the name suffix, so evaluate length on
the user provided name and disconnect the formatted name
code length check.
Closes#8390
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
OpenWrt commit 3cc56a5 chaged the default value of `mobility_domain` and
`r1_key_holder` options. This commit removes the stale hard-coded `4f57`
from luci to avoid ambiguity.
Closes: openwrt/luci#8267
Signed-off-by: Youfu Zhang <zhangyoufu@gmail.com>
Adds PoE/PSE configuration support for modern linux (PSE-PD).
This change is based on the PSE-PD backport (from 6.17)
and netifd|ubus changes.
* Add getPSE() [receive all status information]
and hasPSE() [has the device PSE hardware?]
* Changes ACL permissions to query network.device status information
* Add two new PoE icons (PoE active with link up + link down) for
the port status page
* Changes port status to show PoE information, next to link information
and data transfer.
* Add a new tab for PoE/PSE to the device configuration,
which will only be displayed if the device supports PSE
Signed-off-by: Carlo Szelinsky <github@szelinsky.de>
odhcpd specific flag. PD-P only works with dhcpv6_pd and dhcpv6.
Also move some DHCPv6 specific settings to a new DHCPv6 tab.
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
For use with dnsmasq tags
Note that a MAC tab is possible but the same functionality
is present in the leases tab which handles MACs and tags.
A MAC tab has a 1:1 tag:MAC relationship, whereas the leases
has a many:many relationship.
The dnsmasq init file needs updating to use 'tag' in
place of 'networkid', which is an older legacy format still
understood by dnsmasq, but all documentation uses 'tag'.
tag names shall not match:
- network devices/interfaces
- service names
Three dnsmasq reserved tag names are:
- known
- !known
- known-othernet
Tag names can be prepended with '!' to invert their usage.
Closes#7178
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
Fiddling with the dnsmasq/odhcpd specific settings is (at least in my
experience) a much less common operation than wanting to see/change
leases and their configuration, so reorder the tabs to show leases first
and dnsmasq/odhcpd tabs second/third.
Signed-off-by: David Härdeman <david@hardeman.nu>
For odhcpd, an empty "dhcpv4" is equivalent to "disabled",
but for dnsmasq, an empty "dhcpv4" is equivalent to "enabled",
so an empty "dhcpv4" is ambiguous.
Fixes https://github.com/openwrt/openwrt/issues/21220
Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
The diagnostics page is using `fs.exec()` to execute command, which blocks
until command exit. Users have to wait for a while to see the result.
When doing IPv6 traceroute, this may cause XHR timeout, if target host
is unreachable. (See issue #7210)
This commit uses new `responseProgress` callback and `stderr` option
added in luci.js and fs.js to update command output.
Signed-off-by: Richard Yu <yurichard3839@gmail.com>
Link: https://github.com/openwrt/luci/pull/7920
We already show the DUID in one table (in the overview), this makes the
tables under the "DHCP > Leases" tab consistent with the overview, and
exposes the DUID/IAID in both.
Signed-off-by: David Härdeman <david@hardeman.nu>
This adds support to LuCI for showing the interface which a given lease
corresponds to (assuming that odhcpd is providing the DHCPv4/6 services,
which the code also checks for).
Signed-off-by: David Härdeman <david@hardeman.nu>
Shorten the lease time description (the header of the tables already
says it contains DHCP leases, so "Remaining Time" is enough), make it
clear that we have DHCPv4/6 leases and not DHCP/DHCPv6 leases.
Signed-off-by: David Härdeman <david@hardeman.nu>
This adds support for the IPv6-only preferred (RFC8925) option to LuCI.
The option is supported by odhcpd since commit
338ca8abb950e4e0448a13d50d6d6567a167d016
Signed-off-by: David Härdeman <david@hardeman.nu>
'Addresses' option entries in the general tab of DHCP and DNS settings are
sometimes (I'm not sure about the exact conditions) passed to upstream resolver,
bypassing local resolution.
A workaround for a small list of domains is to add them to 'Resolve these
locally' option, but this is very tedious to do, and dnsmasq limits it to 1024
characters.
openwrt/openwrt#18610 adds behaviour to add addresses to the local resolution
list automatically, and this commit adds a flag to LuCI to control that.
Signed-off-by: Marko Zajc <marko@zajc.tel>
Dynamically find the mode and bssid position assignments in case their position
should change later.
Signed-off-by: Paul Donald <newtwen+github@gmail.com>
First check the features are installed. Further, verify that some sections
exist which some GUI functions depend on.
Signed-off-by: Paul Donald <newtwen+github@gmail.com>