libvirt/src/network
Michal Privoznik b0f78d626a lib: Fix calling of virNetworkUpdate() driver callback
The order in which virNetworkUpdate() accepts @section and
@command arguments is not the same as in which it passes them
onto networkUpdate() callback. Until recently, it did not really
matter, because calling the API on client side meant arguments
were encoded in reversed order (compared to the public API), but
then on the server it was fixed again - because the server
decoded RPC (still swapped), called public API (still swapped)
and in turn called the network driver callback (with reversing
the order - so magically fixing the order).

Long story short, if the public API is called even number of
times those swaps cancel each other out. The problem is when the
API is called an odd numbed of times - which happens with split
daemons and the right URI. There's one call in the client (e.g.
virsh net-update), the other in a hypervisor daemon (say
virtqemud) which ends up calling the API in the virnetworkd.

The fix is obvious - fix the order in which arguments are passed
to the callback.

But, to maintain compatibility with older, yet unfixed, daemons
new connection feature is introduced. The feature is detected
just before calling the callback and allows client to pass
arguments in correct order (talking to fixed daemon) or in
reversed order (talking to older daemon).

Unfortunately, older client talking to newer daemon can't be
fixed. Let's hope that it's less frequent scenario.

Fixes: 574b9bc66b
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1870552
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2021-03-25 10:10:23 +01:00
..
bridge_driver_linux.c network: eliminate unnecessary labels 2020-07-20 19:11:35 -04:00
bridge_driver_nop.c network: force re-creation of iptables private chains on firewalld restart 2020-05-11 22:54:52 -04:00
bridge_driver_platform.c Remove all Author(s): lines from source file headers 2018-12-13 16:08:38 +00:00
bridge_driver_platform.h network: force re-creation of iptables private chains on firewalld restart 2020-05-11 22:54:52 -04:00
bridge_driver.c lib: Fix calling of virNetworkUpdate() driver callback 2021-03-25 10:10:23 +01:00
bridge_driver.h network: make networkDnsmasqXmlNsDef private to bridge_driver.c 2020-07-04 23:53:48 -04:00
default.xml.in network: Use single quotes in default network configuration 2020-08-04 15:12:18 +02:00
leaseshelper.c virJSONValueArrayAppend: Clear pointer when taking ownership of passed value 2021-02-20 13:26:37 +01:00
libvirt.zone network: explicitly allow icmp/icmpv6 in libvirt zonefile 2019-02-14 15:06:42 -05:00
meson.build build: Remove unused 'conflicts' key from virt_daemon_unit 2021-02-10 09:30:41 -07:00
virtnetworkd.init.in configure: Provide OpenRC scripts for sub-daemons 2019-12-16 10:11:22 +01:00
virtnetworkd.service.in systemd: start libvirtd after firewalld/iptables services 2020-05-05 20:16:02 -04:00
virtnetworkd.sysconf systemd: Move timeout from service files to sysconf files 2020-04-03 11:50:50 +02:00