libvirt/tests/nssdata
Michal Privoznik a7cbfabc2f libvirt_nss: Report newer addresses first
Ideally, a software that's translating domain names would iterate
over all addresses the NSS returned, but some software does not
bother (e.g. ping). What happens is that for instance when
installing a guest, it's assigned one IP address but once it's
installed and rebooted it gets a different IP address (because
client ID used for the first DHCP traffic when installing the
guest was generated dynamically and never saved so after reboot
the guest generated new ID which resulted in different IP address
to be assigned). This results in 'ping $domain' not working
properly as it still pings the old IP address. Well, it might -
NSS plugin does not guarantee any order of addresses.

To resolve this problem, we can sort the array just before
returning it to the caller (ping) so that the newer IP addresses
come before older ones.

Reported-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2019-07-15 13:48:19 +02:00
..
virbr0.macs nss: Introduce libvirt-guest module 2016-12-06 13:34:00 +01:00
virbr0.status libvirt_nss: Report newer addresses first 2019-07-15 13:48:19 +02:00
virbr1.macs nss: Introduce libvirt-guest module 2016-12-06 13:34:00 +01:00
virbr1.status nss: Introduce libvirt-guest module 2016-12-06 13:34:00 +01:00