diff options
author | Lennart Poettering <lennart@poettering.net> | 2014-07-17 01:13:22 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-07-17 01:41:52 +0200 |
commit | e1c959948c0e31d6997bcdfbabfbd077784b2bae (patch) | |
tree | 20110fde60bc894123285e77c329c22ec3a0d8b4 /src/resolve/resolved-dns-scope.c | |
parent | 76f468c8ea568fce98fa75d7f1d540256eb0940a (diff) |
resolved: properly handle MTU logic
Diffstat (limited to 'src/resolve/resolved-dns-scope.c')
-rw-r--r-- | src/resolve/resolved-dns-scope.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/resolve/resolved-dns-scope.c b/src/resolve/resolved-dns-scope.c index 0a70cb1f0f..a39e705a3b 100644 --- a/src/resolve/resolved-dns-scope.c +++ b/src/resolve/resolved-dns-scope.c @@ -102,8 +102,19 @@ int dns_scope_send(DnsScope *s, DnsPacket *p) { return -EMSGSIZE; ifindex = s->link->ifindex; + } else { + uint32_t mtu; + + mtu = manager_find_mtu(s->manager); + if (mtu > 0) { + if (p->size > mtu) + return -EMSGSIZE; + } } + if (p->size > DNS_PACKET_UNICAST_SIZE_MAX) + return -EMSGSIZE; + if (srv->family == AF_INET) r = manager_dns_ipv4_send(s->manager, srv, ifindex, p); else if (srv->family == AF_INET6) |