libvirt/tools/nss
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
..
libvirt_guest_nss.syms nss: Introduce libvirt-guest module 2016-12-06 13:34:00 +01:00
libvirt_nss_bsd.syms nss: FreeBSD support 2016-03-30 10:21:44 +03:00
libvirt_nss.c libvirt_nss: Report newer addresses first 2019-07-15 13:48:19 +02:00
libvirt_nss.h tools: use #pragma once in headers 2019-06-19 17:12:34 +02:00
libvirt_nss.syms Implement _nss_libvirt_gethostbyname4_r 2016-03-18 17:29:53 +01:00