]> git.ipfire.org Git - thirdparty/lldpd.git/commit
client: fix configuration modification
authorVincent Bernat <vincent@bernat.im>
Sun, 2 Nov 2014 15:25:21 +0000 (16:25 +0100)
committerVincent Bernat <vincent@bernat.im>
Sun, 2 Nov 2014 15:25:21 +0000 (16:25 +0100)
commite4c51716848a639daf61eff3e96ad242af3e316b
tree3719f0c5f5b8cc15d484ec2e4e76791a235db3f5
parent625005be708dfe52074448c6b3a2bb26b43a415b
client: fix configuration modification

Handling of configuration change was messy. Whatever configuration item
needed to be updated, a whole lldpd_config structure was sent. The
daemon part was trying to guess what changed by assuming non-0 fields
need to be updated. However, when flags were added, the implementation
became inconsistent. Some flags used 1/2 for true/false, some others
kept 0/1. So, some flags were detected as changed while they were not.

Since we require to provide a current configuration before making any
change, we just copy the whole structure, modify what we want and send
it to the daemon. The daemon will then compare the new structure with
the old one to detect changes. Flags that were using 1/2 logic are now
just using 0/1 like others.
src/daemon/client.c
src/lib/atom-private.c