OpenWrt/LEDE Project

  • Status Closed
  • Percent Complete
    100%
  • Task Type Bug Report
  • Category Base system
  • Assigned To No-one
  • Operating System All
  • Severity Medium
  • Priority Very Low
  • Reported Version Trunk
  • Due in Version Undecided
  • Due Date Undecided
  • Private
Attached to Project: OpenWrt/LEDE Project
Opened by Assader - 16.09.2019
Last edited by Yousong Zhou - 01.11.2019

FS#2505 - uci doubling list entries

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.

   uci_q.c (3.4 KiB)
Closed by  Yousong Zhou
01.11.2019 08:01
Reason for closing:  Not a bug
Project Manager
Yousong Zhou commented on 01.11.2019 08:01
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

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing