diff options
author | Tom Gundersen <teg@jklm.no> | 2015-07-25 05:11:34 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2015-07-27 20:32:24 +0200 |
commit | 72290734be81e83e6ef9520c07692f68095eb5b2 (patch) | |
tree | 5fc7f00f41012d8396f1ee5064e75aa690d1e482 /src/resolve/resolved-dns-scope.c | |
parent | 471d40d92fc8e7b452dff99a156f9e0b520ded20 (diff) |
resolved: scope - write() unicast DNS packets
As we have connect()ed to the desired DNS server, we no longer need to pass
control messages manually when sending packets. Simplify the logic accordingly.
Diffstat (limited to 'src/resolve/resolved-dns-scope.c')
-rw-r--r-- | src/resolve/resolved-dns-scope.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/resolve/resolved-dns-scope.c b/src/resolve/resolved-dns-scope.c index e8c6108924..927a1ddc26 100644 --- a/src/resolve/resolved-dns-scope.c +++ b/src/resolve/resolved-dns-scope.c @@ -153,6 +153,10 @@ int dns_scope_emit(DnsScope *s, int fd, DnsPacket *p) { if (p->size + UDP_PACKET_HEADER_SIZE > mtu) return -EMSGSIZE; + r = manager_write(s->manager, fd, p); + if (r < 0) + return r; + } else if (s->protocol == DNS_PROTOCOL_LLMNR) { if (DNS_PACKET_QDCOUNT(p) > 1) @@ -174,13 +178,13 @@ int dns_scope_emit(DnsScope *s, int fd, DnsPacket *p) { return -EAFNOSUPPORT; if (fd < 0) return fd; + + r = manager_send(s->manager, fd, ifindex, family, &addr, port, p); + if (r < 0) + return r; } else return -EAFNOSUPPORT; - r = manager_send(s->manager, fd, ifindex, family, &addr, port, p); - if (r < 0) - return r; - return 1; } |