From 990682229c05ea1aaf056db9c34acd87b99d8fcf Mon Sep 17 00:00:00 2001 From: Adam Dunkels Date: Tue, 2 Dec 2014 10:43:46 +0100 Subject: [PATCH] Automatically initialize the resolv process --- core/net/ip/resolv.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core/net/ip/resolv.c b/core/net/ip/resolv.c index deac38e6c..8ada86897 100644 --- a/core/net/ip/resolv.c +++ b/core/net/ip/resolv.c @@ -1199,6 +1199,16 @@ PROCESS_THREAD(resolv_process, ev, data) PROCESS_END(); } /*---------------------------------------------------------------------------*/ +static void +init(void) +{ + static uint8_t initialized = 0; + if(!initialized) { + process_start(&resolv_process, NULL); + initialized = 1; + } +} +/*---------------------------------------------------------------------------*/ #if RESOLV_AUTO_REMOVE_TRAILING_DOTS static const char * remove_trailing_dots(const char *name) { @@ -1232,6 +1242,8 @@ resolv_query(const char *name) register struct namemap *nameptr = 0; + init(); + lseq = lseqi = 0; /* Remove trailing dots, if present. */