Configure additional addresses on the lo interface for network-sandbox

This works around some strange behavior in glibc's getaddrinfo()
implementation when the AI_ADDRCONFIG flag is set.

For example:

  struct addrinfo *res, hints = { .ai_family = AF_INET, .ai_flags = AI_ADDRCONFIG };
  getaddrinfo("localhost", NULL, &hints, &res);

This returns no results if there are no non-loopback addresses configured.

Bug: https://bugs.gentoo.org/690758
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=12377#c13
Reviewed-by: Zac Medico <zmedico@gentoo.org>
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
1 file changed