summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-dns-scope.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-08-14 01:00:15 +0200
committerLennart Poettering <lennart@poettering.net>2014-08-14 01:01:43 +0200
commit51323288fc628a5cac50914df915545d685b793e (patch)
tree013681d930ff79f768b5499bb295cc618942a056 /src/resolve/resolved-dns-scope.c
parent12e34d9d58ed4d97e7bdf8c23494c51ee5ec388e (diff)
resolved: allow passing on which protocol, family and interface to look something up
Also, return on which protocol/family/interface we found something.
Diffstat (limited to 'src/resolve/resolved-dns-scope.c')
-rw-r--r--src/resolve/resolved-dns-scope.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/resolve/resolved-dns-scope.c b/src/resolve/resolved-dns-scope.c
index 174249a9f7..396ae19e48 100644
--- a/src/resolve/resolved-dns-scope.c
+++ b/src/resolve/resolved-dns-scope.c
@@ -291,12 +291,18 @@ int dns_scope_tcp_socket(DnsScope *s, int family, const union in_addr_union *add
return ret;
}
-DnsScopeMatch dns_scope_good_domain(DnsScope *s, const char *domain) {
+DnsScopeMatch dns_scope_good_domain(DnsScope *s, int ifindex, uint64_t flags, const char *domain) {
char **i;
assert(s);
assert(domain);
+ if (ifindex != 0 && (!s->link || s->link->ifindex != ifindex))
+ return DNS_SCOPE_NO;
+
+ if ((SD_RESOLVED_FLAGS_MAKE(s->protocol, s->family) & flags) == 0)
+ return DNS_SCOPE_NO;
+
STRV_FOREACH(i, s->domains)
if (dns_name_endswith(domain, *i) > 0)
return DNS_SCOPE_YES;