summaryrefslogtreecommitdiffstats
path: root/src/vnet/dns/resolver_process.c
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2019-05-29 13:46:35 -0400
committerDamjan Marion <dmarion@me.com>2019-05-30 08:55:50 +0000
commit2466f5068f044ddfcb1f300f1f20122030b52221 (patch)
tree89525f6895f8e372b538250b63c1e6ce140a1c0b /src/vnet/dns/resolver_process.c
parent2a2e5938a3a019f94b4acf53191bf4a42d72c68a (diff)
Start the dns resolver process on demand
Change-Id: Iab27b405fb3ca7aed94ae974d57c286c41298c3a Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vnet/dns/resolver_process.c')
-rw-r--r--src/vnet/dns/resolver_process.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/vnet/dns/resolver_process.c b/src/vnet/dns/resolver_process.c
index 5f43fada983..cba659266c9 100644
--- a/src/vnet/dns/resolver_process.c
+++ b/src/vnet/dns/resolver_process.c
@@ -322,15 +322,18 @@ dns_resolver_process (vlib_main_t * vm,
return 0; /* or not */
}
-/* *INDENT-OFF* */
-VLIB_REGISTER_NODE (dns_resolver_node) =
+void
+vnet_dns_create_resolver_process (dns_main_t * dm)
{
- .function = dns_resolver_process,
- .type = VLIB_NODE_TYPE_PROCESS,
- .name = "dns-resolver-process",
-};
-/* *INDENT-ON* */
-
+ /* Already created the resolver process? */
+ if (dm->resolver_process_node_index > 0)
+ return;
+
+ /* No, create it now and make a note of the node index */
+ dm->resolver_process_node_index = vlib_process_create
+ (dm->vlib_main, "dns-resolver-process",
+ dns_resolver_process, 16 /* log2_n_stack_bytes */ );
+}
/*
* fd.io coding-style-patch-verification: ON