summaryrefslogtreecommitdiff
path: root/src/shared/dns-domain.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-11-25 21:15:07 +0100
committerLennart Poettering <lennart@poettering.net>2015-11-25 22:00:07 +0100
commit7e8131e9c6c150732503899a092206578fdc13de (patch)
tree4fdf956859911c9e4368a8e018e798465025920b /src/shared/dns-domain.c
parentdc477e7385e8ab29efb8fadb72ec994077a105c6 (diff)
dns-domain: change dns_srv_type_is_valid() return value to bool
For similar reasons as dns_name_is_root() got changed in the previous commit.
Diffstat (limited to 'src/shared/dns-domain.c')
-rw-r--r--src/shared/dns-domain.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/shared/dns-domain.c b/src/shared/dns-domain.c
index 31b5891435..5a9b091ac4 100644
--- a/src/shared/dns-domain.c
+++ b/src/shared/dns-domain.c
@@ -838,12 +838,12 @@ static bool srv_type_label_is_valid(const char *label, size_t n) {
return true;
}
-int dns_srv_type_verify(const char *name) {
+bool dns_srv_type_is_valid(const char *name) {
unsigned c = 0;
int r;
if (!name)
- return 0;
+ return false;
for (;;) {
char label[DNS_LABEL_MAX];
@@ -851,18 +851,16 @@ int dns_srv_type_verify(const char *name) {
/* This more or less implements RFC 6335, Section 5.1 */
r = dns_label_unescape(&name, label, sizeof(label));
- if (r == -EINVAL)
- return 0;
if (r < 0)
- return r;
+ return false;
if (r == 0)
break;
if (c >= 2)
- return 0;
+ return false;
if (!srv_type_label_is_valid(label, r))
- return 0;
+ return false;
c++;
}
@@ -901,7 +899,7 @@ int dns_service_join(const char *name, const char *type, const char *domain, cha
assert(domain);
assert(ret);
- if (!dns_srv_type_verify(type))
+ if (!dns_srv_type_is_valid(type))
return -EINVAL;
if (!name)