[luci] missing OLSR Hna4 netmask value via LuCI

Kentaro Matsuyama kentaro.matsuyama at gmail.com
Wed Nov 16 06:38:09 CET 2011


Hi list!

I have a question to solve below issue.
When I set OLSR Hna4 option via LuCI OLSR page like this,
Hna4
Network address : 192.168.1.0, Netmask: 255.255.255.0
But LuCI doesn't save netmask value actually because of 'placeholder'
is set at netmask option only in the case of that user want to set
netmask value as "255.255.255.0".
And I noticed if I enter "255.255.255.0" even placeholder show
"255.255.255.0", LuCI save netmask value correctly.
But I think almost user will just leave it.

-- luci/applications/luci-olsr/luasrc/model/cbi/olsr/olsrdhna.lua
msk4 = hna4:option(Value, "netmask", translate("Netmask"))
msk4.datatype = "ip4addr"
msk4.placeholder = "255.255.255.0"

On the other hand, olsrd init script of openwrt side has not default
value of hna4 netmask. (packages/net/olsrd/files/olsrd.init)
Then olsrd init script validate this hna4 netmask value on start, but
in this case netmask value is empty. As a result, olsrd will fail to
boot.

# olsrd_write_hna4, packages/net/olsrd/files/olsrd.init
config_get netmask "$cfg" netmask
if ! validate_olsrd_option "$netmask"; then
	warning_invalid_value olsrd "$cfg" "netmask"
	return 0
fi

I think there is two way to fix this issue at least, just delete
'placeholder' at LuCI or to add default value "255.255.255.0" to olsrd
init script.
But I'm not sure which is the best way, so I wanna ask you guys which
is the best way to fix in this case ?

Regards,
matsu


More information about the luci mailing list