summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-manager.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-07-17 01:13:22 +0200
committerLennart Poettering <lennart@poettering.net>2014-07-17 01:41:52 +0200
commite1c959948c0e31d6997bcdfbabfbd077784b2bae (patch)
tree20110fde60bc894123285e77c329c22ec3a0d8b4 /src/resolve/resolved-manager.c
parent76f468c8ea568fce98fa75d7f1d540256eb0940a (diff)
resolved: properly handle MTU logic
Diffstat (limited to 'src/resolve/resolved-manager.c')
-rw-r--r--src/resolve/resolved-manager.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/resolve/resolved-manager.c b/src/resolve/resolved-manager.c
index 5fbb500fd0..fed9a77973 100644
--- a/src/resolve/resolved-manager.c
+++ b/src/resolve/resolved-manager.c
@@ -878,3 +878,23 @@ void manager_next_dns_server(Manager *m) {
m->current_dns_server = m->dns_servers;
}
+
+uint32_t manager_find_mtu(Manager *m) {
+ uint32_t mtu = 0;
+ Link *l;
+ Iterator i;
+
+ /* If we don't know on which link a DNS packet would be
+ * delivered, let's find the largest MTU that works on all
+ * interfaces we know of */
+
+ HASHMAP_FOREACH(l, m->links, i) {
+ if (l->mtu <= 0)
+ continue;
+
+ if (mtu <= 0 || l->mtu < mtu)
+ mtu = l->mtu;
+ }
+
+ return mtu;
+}