diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2023-02-23 16:41:47 +0000 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2023-02-27 18:52:56 +0100 |
commit | bad252687271c0255f6a077f19cbc19aa0427f8d (patch) | |
tree | 81b86d7561fdeaafd09872db7637a793fef9718b /util.h | |
parent | 8ca907a3f0a095691cdaf56ad610fd802df88146 (diff) | |
download | passt-bad252687271c0255f6a077f19cbc19aa0427f8d.tar passt-bad252687271c0255f6a077f19cbc19aa0427f8d.tar.gz passt-bad252687271c0255f6a077f19cbc19aa0427f8d.tar.bz2 passt-bad252687271c0255f6a077f19cbc19aa0427f8d.tar.lz passt-bad252687271c0255f6a077f19cbc19aa0427f8d.tar.xz passt-bad252687271c0255f6a077f19cbc19aa0427f8d.tar.zst passt-bad252687271c0255f6a077f19cbc19aa0427f8d.zip |
conf, udp: Allow any loopback address to be used as resolver
Andrea reports that with a Fedora 37 guest running on a Fedora 37
host, both using systemd-resolved, with passt connecting them,
running with default options, DNS queries don't work.
systemd-resolved on the host is reachable only at the loopback
address 127.0.0.53.
We advertise the default gateway address to the guest as resolver,
because our local address is of course unreachable from there, which
means we see DNS queries directed to the default gateway, and we
redirect them to 127.0.0.1. However, systemd-resolved doesn't answer
on 127.0.0.1.
To fix this, set @dns_match to the address of the default gateway,
unless a different resolver address is explicitly configured, so that
we know we explicitly have to map DNS queries, in this case, to the
address of the local resolver.
This means that in udp_tap_handler() we need to check, first, if
the destination address of packets matches @dns_match: even if it's
the address of the local gateway, we want to map that to a specific
address, which isn't necessarily 127.0.0.1.
Do the same for IPv6 for consistency, even though IPv6 defines a
single loopback address.
Reported-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Tested-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'util.h')
0 files changed, 0 insertions, 0 deletions