resolved-dns-scope.c revision faec72d5dedae93f43c2dd624de1392ed9bacd80
813e3a6ffcd094696001716480bbd68008cc54c8Patrik Flykt/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
813e3a6ffcd094696001716480bbd68008cc54c8Patrik Flykt This file is part of systemd.
813e3a6ffcd094696001716480bbd68008cc54c8Patrik Flykt Copyright 2014 Lennart Poettering
813e3a6ffcd094696001716480bbd68008cc54c8Patrik Flykt systemd is free software; you can redistribute it and/or modify it
813e3a6ffcd094696001716480bbd68008cc54c8Patrik Flykt under the terms of the GNU Lesser General Public License as published by
813e3a6ffcd094696001716480bbd68008cc54c8Patrik Flykt the Free Software Foundation; either version 2.1 of the License, or
813e3a6ffcd094696001716480bbd68008cc54c8Patrik Flykt (at your option) any later version.
813e3a6ffcd094696001716480bbd68008cc54c8Patrik Flykt systemd is distributed in the hope that it will be useful, but
813e3a6ffcd094696001716480bbd68008cc54c8Patrik Flykt WITHOUT ANY WARRANTY; without even the implied warranty of
813e3a6ffcd094696001716480bbd68008cc54c8Patrik Flykt MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
813e3a6ffcd094696001716480bbd68008cc54c8Patrik Flykt Lesser General Public License for more details.
813e3a6ffcd094696001716480bbd68008cc54c8Patrik Flykt You should have received a copy of the GNU Lesser General Public License
813e3a6ffcd094696001716480bbd68008cc54c8Patrik Flykt along with systemd; If not, see <http://www.gnu.org/licenses/>.
813e3a6ffcd094696001716480bbd68008cc54c8Patrik Flyktint dns_scope_new(Manager *m, DnsScope **ret, DnsScopeType t) {
813e3a6ffcd094696001716480bbd68008cc54c8Patrik Flykt LIST_REMOVE(scopes, s->manager->dns_scopes, s);
f12ed3bf0b315fc88d5fbdf5bdca14b218c86e0cPatrik Flykt r = manager_dns_ipv4_send(s->manager, srv, ifindex, p);
f12ed3bf0b315fc88d5fbdf5bdca14b218c86e0cPatrik Flykt r = manager_dns_ipv6_send(s->manager, srv, ifindex, p);
859cca44f834ab1cc3e41fa6b94744f1856ab027Patrik Flykt fd = socket(srv->family, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0);
859cca44f834ab1cc3e41fa6b94744f1856ab027Patrik Flykt setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &one, sizeof(one));
859cca44f834ab1cc3e41fa6b94744f1856ab027Patrik FlyktDnsScopeMatch dns_scope_test(DnsScope *s, const char *domain) {
947527f8326d3591f252c48fee5426a563f03544Patrik Flykt if (dns_name_endswith(domain, "254.169.in-addr.arpa") ||
859cca44f834ab1cc3e41fa6b94744f1856ab027Patrik Flykt if (dns_name_endswith(domain, "254.169.in-addr.arpa") ||
859cca44f834ab1cc3e41fa6b94744f1856ab027Patrik Flykt dns_name_endswith(domain, "0.8.e.f.ip6.arpa") ||