For some cases it may be required to get a local ip while excluding a
certain ip. This will be used to set a better host.containers.internal
name for pasta networks as it is likely that host eth0 ip == container
ip so in this case we must use different host ip.
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
I want to use this function in both podman and buildah, move it to the
util package as it is not specific to etchosts and export it.
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Copy the libpod/network packages from podman to here so we can use the
same code in buildah as well.
This is mostly a one to one copy only the import paths have been changed
and some errors were added.
Signed-off-by: Paul Holzinger <pholzing@redhat.com>