Re: [OpenWrt-Devel] Default dhcp (client) hostname is unset - Luci implies $(hostname)
On 10/8/14 4:47 AM, Christian Schoenebeck wrote: Inside [buildroot]/feeds/luci/modules/base/luasrc/model/cbi/admin_network/proto_dhcp.lua you find the definition hostname.placeholder = luci.sys.hostname(). It's not default so its never written/used to configuration. From the LuCI point of view placeholder is a sample. (light grey) If it's a default (also used be the system behind LuCI) then its written into the field as if the user write something into the field. Now I see what you mean. It is confusing, though, from a UI because sometimes the ghost values are defaults and sometimes samples. I don't think your last statement is accurate, because there are default values that are not saved in uci. 1) DHCP DNS / General Settings: DNS forwardings /example.org/10.1.2.3 is clearly a sample. 2) ... / Advanced Settings: DNS server port 53, but dhcp.@dnsmasq[0].port is unset. 53 is the default DNS port. Setting it causes dhcp.*.port to be set. 3) ... / Advanced Settings : Max concurrent queries 150, but no dhcp.@dnsmasq[0].* value. 150 is the default value (app default) The only way to tell the difference between a sample and a default would be to know whether the value is reasonable. In the case of DHCP hostname, the default seems reasonable, so it is confusing when udhcpc does not send $HOSTNAME. In 5434f9ac.3050...@openwrt.org, Jow said that some dhcp servers choke on dhcp hostnames. Then, if 99% of OpenWRT configurations are probably where the upstream dhcp server is external, sending a hostname will do more harm than good. Then, back to the UI. Since it is hard to distinguish between default value and example value in DHCP client hostname, can it be changed to empty-string? I tried the following: [[[ git://git.openwrt.org/project/luci.git diff --git a/modules/base/luasrc/model/cbi/admin_network/proto_dhcp.lua b/modules/base/luasrc/model/cbi/admin_network/proto_dhcp.lua index fe3fec6..62047b5 100644 --- a/modules/base/luasrc/model/cbi/admin_network/proto_dhcp.lua +++ b/modules/base/luasrc/model/cbi/admin_network/proto_dhcp.lua @@ -20,7 +20,6 @@ local bcast, defaultroute, peerdns, dns, metric, clientid, vendorclass hostname = section:taboption(general, Value, hostname, translate(Hostname to send when requesting DHCP)) -hostname.placeholder = luci.sys.hostname() hostname.datatype= hostname ]]] -- -Justin justinval...@gmail.com smime.p7s Description: S/MIME Cryptographic Signature ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] Default dhcp (client) hostname is unset - Luci implies $(hostname)
Am 08.10.2014 um 21:07 schrieb Justin Vallon: On 10/8/14 4:47 AM, Christian Schoenebeck wrote: Inside [buildroot]/feeds/luci/modules/base/luasrc/model/cbi/admin_network/proto_dhcp.lua you find the definition hostname.placeholder = luci.sys.hostname(). It's not default so its never written/used to configuration. From the LuCI point of view placeholder is a sample. (light grey) If it's a default (also used be the system behind LuCI) then its written into the field as if the user write something into the field. Now I see what you mean. It is confusing, though, from a UI because sometimes the ghost values are defaults and sometimes samples. I don't think your last statement is accurate, because there are default values that are not saved in uci. 1) DHCP DNS / General Settings: DNS forwardings /example.org/10.1.2.3 is clearly a sample. 2) ... / Advanced Settings: DNS server port 53, but dhcp.@dnsmasq[0].port is unset. 53 is the default DNS port. Setting it causes dhcp.*.port to be set. 3) ... / Advanced Settings : Max concurrent queries 150, but no dhcp.@dnsmasq[0].* value. 150 is the default value (app default) The only way to tell the difference between a sample and a default would be to know whether the value is reasonable. In the case of DHCP hostname, the default seems reasonable, so it is confusing when udhcpc does not send $HOSTNAME. In 5434f9ac.3050...@openwrt.org, Jow said that some dhcp servers choke on dhcp hostnames. Then, if 99% of OpenWRT configurations are probably where the upstream dhcp server is external, sending a hostname will do more harm than good. Then, back to the UI. Since it is hard to distinguish between default value and example value in DHCP client hostname, can it be changed to empty-string? I tried the following: [[[ git://git.openwrt.org/project/luci.git diff --git a/modules/base/luasrc/model/cbi/admin_network/proto_dhcp.lua b/modules/base/luasrc/model/cbi/admin_network/proto_dhcp.lua index fe3fec6..62047b5 100644 --- a/modules/base/luasrc/model/cbi/admin_network/proto_dhcp.lua +++ b/modules/base/luasrc/model/cbi/admin_network/proto_dhcp.lua @@ -20,7 +20,6 @@ local bcast, defaultroute, peerdns, dns, metric, clientid, vendorclass hostname = section:taboption(general, Value, hostname, translate(Hostname to send when requesting DHCP)) -hostname.placeholder = luci.sys.hostname() hostname.datatype= hostname ]]] About the need or not of a hostname for dhcp I can't say anything. Missing knowledge. About LuCI and the applications/scripts behind I can say that the default is normally not set in the config because it's done in the scripts/apps as default. As stated by Jow something like none doesn't work. The placeholder is a good thing to show the user what kind of entry is needed to put in. It's completely removed (no longer displayed) if you start to edit the field. The default is written to the field and you can edit it as you like because it's a text field. ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] Default dhcp (client) hostname is unset - Luci implies $(hostname)
[BB 14.07] In the Luci section for Interface / General Setup, the is a parameter Hostname to send when requesting DHCP. That input field has a ghost value of $HOSTNAME (meaning to me that its default value is $HOSTNAME). However, entering the $HOSTNAME in the field changes the behavior. I can see udhcpc being called with -H $host if I give a value, and no -H if left blank. It appears from command-line options that -H (or newer -x hostname:$HOST) causes the DHCP Hostname option to be sent, but it is not sent otherwise. So either: 1) The dhcp hostname option should be blank to indicate no default value (maintain current behavior) 2) When udhcpc is invoked, it should pass -H $(hostname) in case of default (make backend behave as Luci implies) IMO: I find it nice that many hosts pass their hostname automatically, so that the DHCP active lease list is useful, versus a lot of ? entries and ethernet addresses. So, I would vote for 2. Opinions? Where would this bug get posted? (wiki.openwrt.org is down, so I cannot check the wiki) -- -Justin justinval...@gmail.com smime.p7s Description: S/MIME Cryptographic Signature ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] Default dhcp (client) hostname is unset - Luci implies $(hostname)
On Tue, Oct 7, 2014 at 7:02 PM, Justin Vallon justinval...@gmail.com wrote: So either: 1) The dhcp hostname option should be blank to indicate no default value (maintain current behavior) 2) When udhcpc is invoked, it should pass -H $(hostname) in case of default (make backend behave as Luci implies) IMO: I find it nice that many hosts pass their hostname automatically, so that the DHCP active lease list is useful, versus a lot of ? entries and ethernet addresses. So, I would vote for 2. Opinions? Where would this bug get posted? (wiki.openwrt.org is down, so I cannot check the wiki) The wiki is working for me now... That info is stored on a per interface basis in /etc/config/network (see Link[1]) and is not set by default, although it may pull from /etc/config/system (see Link[2]) if unset in /etc/config/network. The default value in /etc/config/system is 'OpenWrt' Link[1]: http://wiki.openwrt.org/doc/uci/network#protocol.dhcp Link[2]: http://wiki.openwrt.org/doc/uci/system Aaron Z A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects. — Robert Heinlein, Time Enough for Love ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel