From 4bf8888019cbaad44bd3d775bb269042a53bbfc1 Mon Sep 17 00:00:00 2001 From: Dave Barach Date: Wed, 21 Aug 2019 09:11:41 -0400 Subject: dns: add basic functional "make test" case Type: test Signed-off-by: Dave Barach Change-Id: I88e93b510d8d4f7b59f3e630539dc7e0264afa47 --- src/vnet/dns/dns.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/vnet/dns') 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); -- cgit 1.2.3-korg