[OpenWrt-Devel] libuci help

Jo-Philipp Wich jo at mein.io
Sat Mar 28 19:26:56 EDT 2020


Hi,

first of all, dashes are not allowed in section names. Unfortunately, libuci
does not really perform any argument validation so it'll happily allow invalid
names in various places but fail later on, as you've observed.

Furthermore, I suggest to create a named section directly instead of doing
such a complex rename logic. You can create named sections by invoking
uci_set() with a struct uci_ptr that has the package, section and value
members populated. The .value member needs to be set to the type of the
section you want to add ("wifi-iface" in your case) and the .section member
should be set to the name of the section ("home_ap_50" in your case).

~ Jo

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20200329/a1403975/attachment.sig>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list