[OpenWrt-Devel] Default dhcp (client) hostname is unset - Luci implies $(hostname)

Christian Schoenebeck christian.schoenebeck at gmail.com
Wed Oct 8 04:47:30 EDT 2014


Am 08.10.2014 um 07:07 schrieb Justin Vallon:
> On 10/7/14 8:46 PM, Aaron Z wrote:
>> On Tue, Oct 7, 2014 at 7:02 PM, Justin Vallon <justinvallon at 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
>>
> The docs for uci network.${iface}.hostname say that there is no default
> hostname submitted in the DHCP request.  However, Luci seems to imply
> that the default is $HOSTNAME because it shows $HOSTNAME if the field is
> unset.  Your guess ("it may pull from ...") appears to be incorrect, and
> is/was my confusion as well.
> 
> Fixing Luci would seem to be straightforward (default is "").  Fixing
> the backend (default is "$HOSTNAME") would be a change of behavior.  I
> will look into both options.
> 
> 
> 
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
> 
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.


More information about the openwrt-devel mailing list