From 06abfcf6d95762976d37aa5721c16802c649efd4 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Fri, 22 Jul 2022 15:31:13 +1000 Subject: Separately locate external interfaces for IPv4 and IPv6 Now that the back end allows passt/pasta to use different external interfaces for IPv4 and IPv6, use that to do the right thing in the case that the host has IPv4 and IPv6 connectivity via different interfaces. If the user hasn't explicitly chosen an interface, separately search for a suitable external interface for each protocol. As a bonus, this substantially simplifies the external interface probe. It also eliminates a subtle confusing case where in some circumstances we would pick the first interface in interface index order, and sometimes in order of routes returned from netlink. On some network configurations that could cause tests to fail, because the logic in the tests was subtly different (it always used route order). Signed-off-by: David Gibson --- netlink.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'netlink.h') diff --git a/netlink.h b/netlink.h index 261904e..5ce5037 100644 --- a/netlink.h +++ b/netlink.h @@ -7,7 +7,7 @@ #define NETLINK_H int nl_sock_init(const struct ctx *c); -unsigned int nl_get_ext_if(int *v4, int *v6); +unsigned int nl_get_ext_if(sa_family_t af); void nl_route(int ns, unsigned int ifi, sa_family_t af, void *gw); void nl_addr(int ns, unsigned int ifi, sa_family_t af, void *addr, int *prefix_len, void *addr_l); -- cgit v1.2.3