aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/dns
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2019-08-21 09:11:41 -0400
committerFlorin Coras <florin.coras@gmail.com>2019-08-21 14:51:38 +0000
commit4bf8888019cbaad44bd3d775bb269042a53bbfc1 (patch)
tree7632561cb7ff43166b68fb2462fca4e0f07314ad /src/vnet/dns
parent17f2a7bbf25f54dbd71aa8f377875828b7b88e35 (diff)
dns: add basic functional "make test" case
Type: test Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I88e93b510d8d4f7b59f3e630539dc7e0264afa47
Diffstat (limited to 'src/vnet/dns')
-rw-r--r--src/vnet/dns/dns.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/vnet/dns/dns.c b/src/vnet/dns/dns.c
index eac95450485..304aa1868fe 100644
--- a/src/vnet/dns/dns.c
+++ b/src/vnet/dns/dns.c
@@ -821,6 +821,10 @@ vnet_dns_resolve_name (dns_main_t * dm, u8 * name, dns_pending_request_t * t,
/* In case we can't actually answer the question right now... */
*retp = 0;
+ /* binary API caller might forget to set the name. Guess how we know. */
+ if (name[0] == 0)
+ return VNET_API_ERROR_INVALID_VALUE;
+
dns_cache_lock (dm);
search_again:
p = hash_get_mem (dm->cache_entry_by_name, name);