diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2024-06-18 13:00:51 +0200 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2024-06-19 15:00:55 +0200 |
commit | f301bb18b5b30ad93a706616bdc581c42ba4cbe2 (patch) | |
tree | 3873b1238af8c304f9200d941f4abc0d1728ef51 /tap.c | |
parent | 450a6131beabd6537f2460bcc110a9a961697649 (diff) | |
download | passt-f301bb18b5b30ad93a706616bdc581c42ba4cbe2.tar passt-f301bb18b5b30ad93a706616bdc581c42ba4cbe2.tar.gz passt-f301bb18b5b30ad93a706616bdc581c42ba4cbe2.tar.bz2 passt-f301bb18b5b30ad93a706616bdc581c42ba4cbe2.tar.lz passt-f301bb18b5b30ad93a706616bdc581c42ba4cbe2.tar.xz passt-f301bb18b5b30ad93a706616bdc581c42ba4cbe2.tar.zst passt-f301bb18b5b30ad93a706616bdc581c42ba4cbe2.zip |
netlink: Ignore EHOSTUNREACH failures when duplicating routes
To implicitly resolve possible dependencies between routes as we
duplicate them into the target namespace, we go through a set of n
routes n times, and ignore EEXIST responses to netlink messages (we
already inserted the route) and ENETUNREACH (we didn't insert the
route yet, but we need to insert another one first).
Until now, we didn't ignore EHOSTUNREACH responses. However,
NetworkManager users with multiple non-subnet routes for the same
interface report that pasta exits with "no route to host" while
duplicating routes.
This happens because NetworkManager sets the 'noprefixroute' attribute
on addresses, meaning that the kernel won't create subnet routes
automatically depending on the prefix length of the address. We copy
this attribute as we copy the address into the target namespace, and
as a result, the kernel doesn't create subnet routes in the target
namespace either.
This means that the gateway for routes that are inserted later can be
unreachable at some points during the sequence of route duplication.
That is, we don't just have dependencies between regular routes, but
we can also have dependencies between regular routes and subnet
routes, as subnet routes are not automatically inserted in advance.
Link: https://github.com/containers/podman/issues/22824
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'tap.c')
0 files changed, 0 insertions, 0 deletions