Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FS#2505 - uci doubling list entries #7359

Closed
openwrt-bot opened this issue Sep 16, 2019 · 1 comment
Closed

FS#2505 - uci doubling list entries #7359

openwrt-bot opened this issue Sep 16, 2019 · 1 comment
Labels

Comments

@openwrt-bot
Copy link

Assader:

Hello.
Im facing some problems with UCI C API and really want to know if im doing something wrong or it is a bug, that has to be fixed.

The version of UCI is commit 415f9e48436d29f612348f58f546b3ad8d74ac38', the version of libubox is commit ecf56174da9614a0b3107d33def463eefb4d7785'. Built with `gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0'. Tell me if you need more information about my system.

You can observe my code in the attached file. There im trying to add two list entries to the lan' section of dhcp' UCI package.
If i execute it and then cat config file i get:

[~] > cat /etc/config/dhcp

config dhcp 'lan'
list my_list 'my_first_entry'
list my_list 'my_second_list_entry'
list my_list 'my_first_entry'
list my_list 'my_second_list_entry'

So every line i add with uci_add_list is beein doubled.

But!
When i uncomment lines and delete list first (it could not even exist) i get correct output:

[~] > cat /etc/config/dhcp

config dhcp 'lan'
list my_list 'my_first_entry'
list my_list 'my_second_list_entry'

If im adding list entry via console, add_list works just as expected. I read the code, but i was unable to find any key differences comparing to mine.

Thanks for you attention.

@openwrt-bot
Copy link
Author

yousong:

uci_save() // save changes as delta file uci_commit() // apply deltas to &ptr.p (doubled), write to file

The sequence is different from uci cli interactions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant