opentechinstitute / commotion-feed

Feed of Commotion components to be pulled in by OpenWRT
GNU Affero General Public License v3.0
5 stars 11 forks source link

Allow adding hostnames to olsrd's nameservice plugin #58

Open dismantl opened 10 years ago

dismantl commented 10 years ago

Currently, due to input validation in olsrd's init script, there is no way to add IP/hostname pairs to the nameservice plugin. The format olsrd expects in its config file for IP/hostname entries is:

PlParam "1.2.3.4" "nodename"

Olsrd's init script turns /etc/config/olsrd UCI entries into the olsrd config file. So for IP/hostname pairs, the option name (the IP address) would contain periods, which is disallowed in UCI.

To solve this issue, we would need to add logic to the olsrd init script to convert some new option, like hostname for instance, into the right format for the olsrd config file. So as an example, the following line in /etc/config/olsrd:

option hostname "1.2.3.4/nodename"

would be converted into:

PlParam "1.2.3.4" "nodename"

in the generated olsrd config file, /var/run/olsrd.conf.