From 450a6131beabd6537f2460bcc110a9a961697649 Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Tue, 18 Jun 2024 18:55:43 +0200 Subject: netlink: With no default route, pick the first interface with a route While commit f919dc7a4b1c ("conf, netlink: Don't require a default route to start") sounded reasonable in the assumption that, if we don't find default routes for a given address family, we can still proceed by selecting an interface with any route *iff it's the only one for that protocol family*, Jelle reported a further issue in a similar setup. There, multiple interfaces are present, and while remote container connectivity doesn't matter for the container, local connectivity is desired. There are no default routes, but those multiple interfaces all have non-default routes, so we should just pick one and start. Pick the first interface reported by the kernel with any route, if there are no default routes. There should be no harm in doing so. Reported-by: Jelle van der Waa Reported-by: Martin Pitt Link: https://bugzilla.redhat.com/show_bug.cgi?id=2277954 Signed-off-by: Stefano Brivio Reviewed-by: David Gibson Reviewed-by: Paul Holzinger --- passt.1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'passt.1') diff --git a/passt.1 b/passt.1 index 3a23a43..15eb336 100644 --- a/passt.1 +++ b/passt.1 @@ -149,8 +149,8 @@ This option can be specified zero (for defaults) to two times (once for IPv4, once for IPv6). By default, assigned IPv4 and IPv6 addresses are taken from the host interfaces with the first default route, if any, for the corresponding IP version. If no -default routes are available and there is just one interface with any route, -that interface will be chosen instead. +default routes are available and there is any interface with any route for a +given IP version, the first of these interfaces will be chosen instead. .TP .BR \-n ", " \-\-netmask " " \fImask -- cgit v1.2.3