aboutsummaryrefslogtreecommitdiff
path: root/src/gns/nss/nss_gns.c
diff options
context:
space:
mode:
authorBertrand Marc <beberking@gmail.com>2013-08-03 13:07:32 +0200
committerBertrand Marc <beberking@gmail.com>2013-08-03 13:07:32 +0200
commit1ae32bc989973c2e8909c3b085d34b2454f92d1e (patch)
treedfde89b41437def7ce23af24db53a11a9b5f1075 /src/gns/nss/nss_gns.c
parent740b30688bd745a527f96f9116c19acb3480971a (diff)
Imported Upstream version 0.9.5a
Diffstat (limited to 'src/gns/nss/nss_gns.c')
-rw-r--r--src/gns/nss/nss_gns.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/gns/nss/nss_gns.c b/src/gns/nss/nss_gns.c
index 3bb45a1..ce9dcf3 100644
--- a/src/gns/nss/nss_gns.c
+++ b/src/gns/nss/nss_gns.c
@@ -4,8 +4,8 @@
Parts taken from: nss.c in nss-mdns
nss-mdns is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published
- by the Free Software Foundation; either version 2 of the License,
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3 of the License,
or (at your option) any later version.
nss-mdns is distributed in the hope that it will be useful, but1
@@ -61,13 +61,13 @@ static int ends_with(const char *name, const char* suffix) {
/**
- * Check if name is inside .gnunet or .zkey TLD
+ * Check if name is inside .gads or .zkey TLD
*
* @param name name to check
* @return 1 if true
*/
static int verify_name_allowed(const char *name) {
- return ends_with(name, ".gnunet") || ends_with(name, ".zkey");
+ return ends_with(name, ".gads") || ends_with(name, ".zkey");
}
/**
@@ -140,13 +140,19 @@ enum nss_status _nss_gns_gethostbyname2_r(
if (!gns_resolve_name(af, name, &u) == 0)
{
status = NSS_STATUS_NOTFOUND;
+ goto finish;
}
}
+ else
+ {
+ status = NSS_STATUS_UNAVAIL;
+ goto finish;
+ }
if (u.count == 0) {
*errnop = ETIMEDOUT;
*h_errnop = HOST_NOT_FOUND;
- printf("not found\n");
+ status = NSS_STATUS_NOTFOUND;
goto finish;
}