resolved: be more careful with weird links with low MTUs
authorLennart Poettering <lennart@poettering.net>
Tue, 11 May 2021 20:21:52 +0000 (22:21 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 12 May 2021 10:15:56 +0000 (12:15 +0200)
commit5a0d0b8f9cdfcbb82c4a89b28f0ebce414c9ecfe
tree6d14b9bfab5dd53d970b2a58540e1ac5928746f8
parent971c07fc6812315c2b27015dfcc652a747f919ed
resolved: be more careful with weird links with low MTUs

Apparently CAN links will show up in rtnetlink with very low MTUs. We
shouldn't consider them relevant if no IP is spoken over them, since
these MTUs are irrelevant for us then.

Hence, let's check if there's an address assigned to the link before
considering its MTU.

As additional safety net filter out MTUs smaller than the minimum DNS
packet size, too.

Finally, in case we don't find any suitable interface MTU, let's default
to 1500 as the generic Ethernet MTU.

Fixes: #19396
src/resolve/resolved-manager.c