]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: split off c-ares code from nhrpd
authorDavid Lamparter <equinox@diac24.net>
Thu, 23 May 2019 10:23:02 +0000 (12:23 +0200)
committerDavid Lamparter <equinox@diac24.net>
Wed, 3 Jul 2019 15:15:34 +0000 (17:15 +0200)
This is useful in other places too, e.g. for BMP outbound connections.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
16 files changed:
configure.ac
debian/frr.install
lib/command.c
lib/command.h
lib/lib_errors.c
lib/lib_errors.h
lib/resolver.c [new file with mode: 0644]
lib/resolver.h [new file with mode: 0644]
lib/subdir.am
nhrpd/nhrp_errors.c
nhrpd/nhrp_errors.h
nhrpd/nhrp_main.c
nhrpd/nhrpd.h
nhrpd/resolver.c [deleted file]
nhrpd/subdir.am
vtysh/vtysh_config.c

index 9b57c2ec9b3461ca9ba6511ac9479137f04b6b9d..0911b96900265c10c256bd964ba34d43a758246e 100755 (executable)
@@ -1560,7 +1560,7 @@ if test "${NHRPD}" != ""; then
     AC_MSG_ERROR([trying to build nhrpd, but libcares not found. install c-ares and its -dev headers.])
   ])
 fi
-
+AM_CONDITIONAL([CARES], [test "${NHRPD}" != ""])
 
 dnl ------------------
 dnl check Net-SNMP library
index ebb87a0b3ee751548f77af1fd3a89c4036a367aa..fe34b23d025cc6ea24c4a5e5b64e79988c06cfb0 100644 (file)
@@ -2,6 +2,7 @@ etc/
 usr/bin/vtysh
 usr/bin/mtracebis
 usr/lib/*/frr/libfrr.*
+usr/lib/*/frr/libfrrcares.*
 usr/lib/*/frr/libfrrospfapiclient.*
 usr/lib/frr/*.sh
 usr/lib/frr/*d
index f257c7d0f9565b11193381b5f4137c86eaeb5ce8..c8fbf2272105a6bbd1fbabda22e477a4171b723d 100644 (file)
@@ -85,6 +85,7 @@ const char *node_names[] = {
        "northbound debug",         // NORTHBOUND_DEBUG_NODE,
        "vnc debug",                // DEBUG_VNC_NODE,
        "route-map debug",          /* RMAP_DEBUG_NODE */
+       "resolver debug",           /* RESOLVER_DEBUG_NODE */
        "aaa",                      // AAA_NODE,
        "keychain",                 // KEYCHAIN_NODE,
        "keychain key",             // KEYCHAIN_KEY_NODE,
index de38563f96ecf13223a510c6922bb6bfc6df0b3c..08d6128af4e2d63478cd1ba31b846550476b8ec7 100644 (file)
@@ -94,6 +94,7 @@ enum node_type {
        NORTHBOUND_DEBUG_NODE,   /* Northbound Debug node. */
        DEBUG_VNC_NODE,          /* Debug VNC node. */
        RMAP_DEBUG_NODE,         /* Route-map debug node */
+       RESOLVER_DEBUG_NODE,     /* Resolver debug node */
        AAA_NODE,                /* AAA node. */
        KEYCHAIN_NODE,           /* Key-chain node. */
        KEYCHAIN_KEY_NODE,       /* Key-chain key node. */
index e0559f332d286184e617699996ae9ab11f1374b0..6e5088142a10c3985d09c4048d9671ff2afc959e 100644 (file)
@@ -356,6 +356,12 @@ static struct log_ref ferr_lib_err[] = {
                .description = "A callback used to process a configuration change has returned an error while applying the changes",
                .suggestion = "Gather log data and open an Issue.",
        },
+       {
+               .code = EC_LIB_RESOLVER,
+               .title = "DNS Resolution",
+               .description = "An error was detected while attempting to resolve a hostname",
+               .suggestion = "Ensure that DNS is working properly and the hostname is configured in dns.  If you are still seeing this error, open an issue"
+       },
        {
                .code = END_FERR,
        }
index 996a16ba95b6bedbd26b82237a0869f27ef1a262..4730b6aa330721ee5c4fc469c097e72d855d9c92 100644 (file)
@@ -84,6 +84,7 @@ enum lib_log_refs {
        EC_LIB_GRPC_INIT,
        EC_LIB_ID_CONSISTENCY,
        EC_LIB_ID_EXHAUST,
+       EC_LIB_RESOLVER,
 };
 
 extern void lib_error_init(void);
diff --git a/lib/resolver.c b/lib/resolver.c
new file mode 100644 (file)
index 0000000..001c293
--- /dev/null
@@ -0,0 +1,245 @@
+/* C-Ares integration to Quagga mainloop
+ * Copyright (c) 2014-2015 Timo Teräs
+ *
+ * This file is free software: you may copy, redistribute and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <ares.h>
+#include <ares_version.h>
+
+#include "vector.h"
+#include "thread.h"
+#include "lib_errors.h"
+#include "resolver.h"
+#include "command.h"
+
+struct resolver_state {
+       ares_channel channel;
+       struct thread_master *master;
+       struct thread *timeout;
+       vector read_threads, write_threads;
+};
+
+static struct resolver_state state;
+static bool resolver_debug;
+
+#define THREAD_RUNNING ((struct thread *)-1)
+
+static void resolver_update_timeouts(struct resolver_state *r);
+
+static int resolver_cb_timeout(struct thread *t)
+{
+       struct resolver_state *r = THREAD_ARG(t);
+
+       r->timeout = THREAD_RUNNING;
+       ares_process(r->channel, NULL, NULL);
+       r->timeout = NULL;
+       resolver_update_timeouts(r);
+
+       return 0;
+}
+
+static int resolver_cb_socket_readable(struct thread *t)
+{
+       struct resolver_state *r = THREAD_ARG(t);
+       int fd = THREAD_FD(t);
+
+       vector_set_index(r->read_threads, fd, THREAD_RUNNING);
+       ares_process_fd(r->channel, fd, ARES_SOCKET_BAD);
+       if (vector_lookup(r->read_threads, fd) == THREAD_RUNNING) {
+               t = NULL;
+               thread_add_read(r->master, resolver_cb_socket_readable, r, fd,
+                               &t);
+               vector_set_index(r->read_threads, fd, t);
+       }
+       resolver_update_timeouts(r);
+
+       return 0;
+}
+
+static int resolver_cb_socket_writable(struct thread *t)
+{
+       struct resolver_state *r = THREAD_ARG(t);
+       int fd = THREAD_FD(t);
+
+       vector_set_index(r->write_threads, fd, THREAD_RUNNING);
+       ares_process_fd(r->channel, ARES_SOCKET_BAD, fd);
+       if (vector_lookup(r->write_threads, fd) == THREAD_RUNNING) {
+               t = NULL;
+               thread_add_write(r->master, resolver_cb_socket_writable, r, fd,
+                                &t);
+               vector_set_index(r->write_threads, fd, t);
+       }
+       resolver_update_timeouts(r);
+
+       return 0;
+}
+
+static void resolver_update_timeouts(struct resolver_state *r)
+{
+       struct timeval *tv, tvbuf;
+
+       if (r->timeout == THREAD_RUNNING)
+               return;
+
+       THREAD_OFF(r->timeout);
+       tv = ares_timeout(r->channel, NULL, &tvbuf);
+       if (tv) {
+               unsigned int timeoutms = tv->tv_sec * 1000 + tv->tv_usec / 1000;
+               thread_add_timer_msec(r->master, resolver_cb_timeout, r,
+                                     timeoutms, &r->timeout);
+       }
+}
+
+static void ares_socket_cb(void *data, ares_socket_t fd, int readable,
+                          int writable)
+{
+       struct resolver_state *r = (struct resolver_state *)data;
+       struct thread *t;
+
+       if (readable) {
+               t = vector_lookup_ensure(r->read_threads, fd);
+               if (!t) {
+                       thread_add_read(r->master, resolver_cb_socket_readable,
+                                       r, fd, &t);
+                       vector_set_index(r->read_threads, fd, t);
+               }
+       } else {
+               t = vector_lookup(r->read_threads, fd);
+               if (t) {
+                       if (t != THREAD_RUNNING) {
+                               THREAD_OFF(t);
+                       }
+                       vector_unset(r->read_threads, fd);
+               }
+       }
+
+       if (writable) {
+               t = vector_lookup_ensure(r->write_threads, fd);
+               if (!t) {
+                       thread_add_read(r->master, resolver_cb_socket_writable,
+                                       r, fd, &t);
+                       vector_set_index(r->write_threads, fd, t);
+               }
+       } else {
+               t = vector_lookup(r->write_threads, fd);
+               if (t) {
+                       if (t != THREAD_RUNNING) {
+                               THREAD_OFF(t);
+                       }
+                       vector_unset(r->write_threads, fd);
+               }
+       }
+}
+
+
+static void ares_address_cb(void *arg, int status, int timeouts,
+                           struct hostent *he)
+{
+       struct resolver_query *query = (struct resolver_query *)arg;
+       union sockunion addr[16];
+       size_t i;
+
+       if (status != ARES_SUCCESS) {
+               if (resolver_debug)
+                       zlog_debug("[%p] Resolving failed", query);
+
+               query->callback(query, -1, NULL);
+               query->callback = NULL;
+               return;
+       }
+
+       for (i = 0; i < array_size(addr) && he->h_addr_list[i] != NULL; i++) {
+               memset(&addr[i], 0, sizeof(addr[i]));
+               addr[i].sa.sa_family = he->h_addrtype;
+               switch (he->h_addrtype) {
+               case AF_INET:
+                       memcpy(&addr[i].sin.sin_addr,
+                              (uint8_t *)he->h_addr_list[i], he->h_length);
+                       break;
+               case AF_INET6:
+                       memcpy(&addr[i].sin6.sin6_addr,
+                              (uint8_t *)he->h_addr_list[i], he->h_length);
+                       break;
+               }
+       }
+
+       if (resolver_debug)
+               zlog_debug("[%p] Resolved with %d results", query, (int)i);
+
+       query->callback(query, i, &addr[0]);
+       query->callback = NULL;
+}
+
+void resolver_resolve(struct resolver_query *query, int af,
+                     const char *hostname,
+                     void (*callback)(struct resolver_query *, int,
+                                      union sockunion *))
+{
+       if (query->callback != NULL) {
+               flog_err(
+                       EC_LIB_RESOLVER,
+                       "Trying to resolve '%s', but previous query was not finished yet",
+                       hostname);
+               return;
+       }
+
+       if (resolver_debug)
+               zlog_debug("[%p] Resolving '%s'", query, hostname);
+
+       query->callback = callback;
+       ares_gethostbyname(state.channel, hostname, af, ares_address_cb, query);
+       resolver_update_timeouts(&state);
+}
+
+DEFUN(debug_resolver,
+      debug_resolver_cmd,
+      "[no] debug resolver",
+      NO_STR
+      DEBUG_STR
+      "Debug DNS resolver actions\n")
+{
+       resolver_debug = (argc == 2);
+       return CMD_SUCCESS;
+}
+
+static struct cmd_node resolver_debug_node = {RESOLVER_DEBUG_NODE, "", 1};
+
+static int resolver_config_write_debug(struct vty *vty)
+{
+       if (resolver_debug)
+               vty_out(vty, "debug resolver\n");
+       return 1;
+}
+
+
+void resolver_init(struct thread_master *tm)
+{
+       struct ares_options ares_opts;
+
+       state.master = tm;
+       state.read_threads = vector_init(1);
+       state.write_threads = vector_init(1);
+
+       ares_opts = (struct ares_options){
+               .sock_state_cb = &ares_socket_cb,
+               .sock_state_cb_data = &state,
+               .timeout = 2,
+               .tries = 3,
+       };
+
+       ares_init_options(&state.channel, &ares_opts,
+                         ARES_OPT_SOCK_STATE_CB | ARES_OPT_TIMEOUT
+                                 | ARES_OPT_TRIES);
+
+       install_node(&resolver_debug_node, resolver_config_write_debug);
+       install_element(CONFIG_NODE, &debug_resolver_cmd);
+       install_element(ENABLE_NODE, &debug_resolver_cmd);
+}
diff --git a/lib/resolver.h b/lib/resolver.h
new file mode 100644 (file)
index 0000000..bc6326e
--- /dev/null
@@ -0,0 +1,25 @@
+/* C-Ares integration to Quagga mainloop
+ * Copyright (c) 2014-2015 Timo Teräs
+ *
+ * This file is free software: you may copy, redistribute and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#ifndef _FRR_RESOLVER_H
+#define _FRR_RESOLVER_H
+
+#include "thread.h"
+#include "sockunion.h"
+
+struct resolver_query {
+       void (*callback)(struct resolver_query *, int n, union sockunion *);
+};
+
+void resolver_init(struct thread_master *tm);
+void resolver_resolve(struct resolver_query *query, int af,
+                     const char *hostname, void (*cb)(struct resolver_query *,
+                                                      int, union sockunion *));
+
+#endif /* _FRR_RESOLVER_H */
index b0cf77ee92fbfe73b757d1ba2646e93e8d66010a..aa89622028a881434489ee995c545af7544771c2 100644 (file)
@@ -285,6 +285,21 @@ lib_libfrrsnmp_la_SOURCES = \
        lib/snmp.c \
        # end
 
+#
+# c-ares support
+#
+if CARES
+lib_LTLIBRARIES += lib/libfrrcares.la
+pkginclude_HEADERS += lib/resolver.h
+endif
+
+lib_libfrrcares_la_CFLAGS = $(WERROR) $(CARES_CFLAGS)
+lib_libfrrcares_la_LDFLAGS = -version-info 0:0:0
+lib_libfrrcares_la_LIBADD = $(CARES_LIBS)
+lib_libfrrcares_la_SOURCES = \
+       lib/resolver.c \
+       #end
+
 #
 # ZeroMQ support
 #
index 4c4f55be9ea3639c69f41e5fc7ee5c52acc5acab..741e64d8b3c02e064c5bd14bf764c3675a9c8a61 100644 (file)
@@ -31,12 +31,6 @@ static struct log_ref ferr_nhrp_err[] = {
                .description = "NHRP has detected a error with the Strongswan code",
                .suggestion = "Ensure that StrongSwan is configured correctly.  Restart StrongSwan and FRR"
        },
-       {
-               .code = EC_NHRP_RESOLVER,
-               .title = "NHRP DNS Resolution",
-               .description = "NHRP has detected an error in an attempt to resolve a hostname",
-               .suggestion = "Ensure that DNS is working properly and the hostname is configured in dns.  If you are still seeing this error, open an issue"
-       },
        {
                .code = END_FERR,
        }
index 593714786ab8b869a85312ec911639a737523033..d4958358febf8b088b35419ef9e96396b9e9b6f1 100644 (file)
@@ -25,7 +25,6 @@
 
 enum nhrp_log_refs {
        EC_NHRP_SWAN = NHRP_FERR_START,
-       EC_NHRP_RESOLVER,
 };
 
 extern void nhrp_error_init(void);
index d7c485f0a0506895cb5e4722bb7ee7bb976ee0d9..969638cd77f14b5284e27239535f76f8fd495347 100644 (file)
@@ -141,7 +141,7 @@ int main(int argc, char **argv)
        nhrp_error_init();
        vrf_init(NULL, NULL, NULL, NULL, NULL);
        nhrp_interface_init();
-       resolver_init();
+       resolver_init(master);
 
        /* Run with elevated capabilities, as for all netlink activity
         * we need privileges anyway. */
index 89de145e65016f4a187b301c78bbccf1b8551087..670c9f4f18c6878d1e7b7a6d86b925d4310e0bea 100644 (file)
@@ -16,6 +16,7 @@
 #include "zclient.h"
 #include "debug.h"
 #include "memory.h"
+#include "resolver.h"
 
 DECLARE_MGROUP(NHRPD)
 
@@ -84,15 +85,6 @@ static inline int notifier_active(struct notifier_list *l)
        return !list_empty(&l->notifier_head);
 }
 
-struct resolver_query {
-       void (*callback)(struct resolver_query *, int n, union sockunion *);
-};
-
-void resolver_init(void);
-void resolver_resolve(struct resolver_query *query, int af,
-                     const char *hostname, void (*cb)(struct resolver_query *,
-                                                      int, union sockunion *));
-
 void nhrp_zebra_init(void);
 void nhrp_zebra_terminate(void);
 
diff --git a/nhrpd/resolver.c b/nhrpd/resolver.c
deleted file mode 100644 (file)
index 64b16e7..0000000
+++ /dev/null
@@ -1,213 +0,0 @@
-/* C-Ares integration to Quagga mainloop
- * Copyright (c) 2014-2015 Timo Teräs
- *
- * This file is free software: you may copy, redistribute and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <ares.h>
-#include <ares_version.h>
-
-#include "vector.h"
-#include "thread.h"
-#include "lib_errors.h"
-
-#include "nhrpd.h"
-#include "nhrp_errors.h"
-
-struct resolver_state {
-       ares_channel channel;
-       struct thread *timeout;
-       vector read_threads, write_threads;
-};
-
-static struct resolver_state state;
-
-#define THREAD_RUNNING ((struct thread *)-1)
-
-static void resolver_update_timeouts(struct resolver_state *r);
-
-static int resolver_cb_timeout(struct thread *t)
-{
-       struct resolver_state *r = THREAD_ARG(t);
-
-       r->timeout = THREAD_RUNNING;
-       ares_process(r->channel, NULL, NULL);
-       r->timeout = NULL;
-       resolver_update_timeouts(r);
-
-       return 0;
-}
-
-static int resolver_cb_socket_readable(struct thread *t)
-{
-       struct resolver_state *r = THREAD_ARG(t);
-       int fd = THREAD_FD(t);
-
-       vector_set_index(r->read_threads, fd, THREAD_RUNNING);
-       ares_process_fd(r->channel, fd, ARES_SOCKET_BAD);
-       if (vector_lookup(r->read_threads, fd) == THREAD_RUNNING) {
-               t = NULL;
-               thread_add_read(master, resolver_cb_socket_readable, r, fd, &t);
-               vector_set_index(r->read_threads, fd, t);
-       }
-       resolver_update_timeouts(r);
-
-       return 0;
-}
-
-static int resolver_cb_socket_writable(struct thread *t)
-{
-       struct resolver_state *r = THREAD_ARG(t);
-       int fd = THREAD_FD(t);
-
-       vector_set_index(r->write_threads, fd, THREAD_RUNNING);
-       ares_process_fd(r->channel, ARES_SOCKET_BAD, fd);
-       if (vector_lookup(r->write_threads, fd) == THREAD_RUNNING) {
-               t = NULL;
-               thread_add_write(master, resolver_cb_socket_writable, r, fd,
-                                &t);
-               vector_set_index(r->write_threads, fd, t);
-       }
-       resolver_update_timeouts(r);
-
-       return 0;
-}
-
-static void resolver_update_timeouts(struct resolver_state *r)
-{
-       struct timeval *tv, tvbuf;
-
-       if (r->timeout == THREAD_RUNNING)
-               return;
-
-       THREAD_OFF(r->timeout);
-       tv = ares_timeout(r->channel, NULL, &tvbuf);
-       if (tv) {
-               unsigned int timeoutms = tv->tv_sec * 1000 + tv->tv_usec / 1000;
-               thread_add_timer_msec(master, resolver_cb_timeout, r, timeoutms,
-                                     &r->timeout);
-       }
-}
-
-static void ares_socket_cb(void *data, ares_socket_t fd, int readable,
-                          int writable)
-{
-       struct resolver_state *r = (struct resolver_state *)data;
-       struct thread *t;
-
-       if (readable) {
-               t = vector_lookup_ensure(r->read_threads, fd);
-               if (!t) {
-                       thread_add_read(master, resolver_cb_socket_readable, r,
-                                       fd, &t);
-                       vector_set_index(r->read_threads, fd, t);
-               }
-       } else {
-               t = vector_lookup(r->read_threads, fd);
-               if (t) {
-                       if (t != THREAD_RUNNING) {
-                               THREAD_OFF(t);
-                       }
-                       vector_unset(r->read_threads, fd);
-               }
-       }
-
-       if (writable) {
-               t = vector_lookup_ensure(r->write_threads, fd);
-               if (!t) {
-                       thread_add_read(master, resolver_cb_socket_writable, r,
-                                       fd, &t);
-                       vector_set_index(r->write_threads, fd, t);
-               }
-       } else {
-               t = vector_lookup(r->write_threads, fd);
-               if (t) {
-                       if (t != THREAD_RUNNING) {
-                               THREAD_OFF(t);
-                       }
-                       vector_unset(r->write_threads, fd);
-               }
-       }
-}
-
-void resolver_init(void)
-{
-       struct ares_options ares_opts;
-
-       state.read_threads = vector_init(1);
-       state.write_threads = vector_init(1);
-
-       ares_opts = (struct ares_options){
-               .sock_state_cb = &ares_socket_cb,
-               .sock_state_cb_data = &state,
-               .timeout = 2,
-               .tries = 3,
-       };
-
-       ares_init_options(&state.channel, &ares_opts,
-                         ARES_OPT_SOCK_STATE_CB | ARES_OPT_TIMEOUT
-                                 | ARES_OPT_TRIES);
-}
-
-
-static void ares_address_cb(void *arg, int status, int timeouts,
-                           struct hostent *he)
-{
-       struct resolver_query *query = (struct resolver_query *)arg;
-       union sockunion addr[16];
-       size_t i;
-
-       if (status != ARES_SUCCESS) {
-               debugf(NHRP_DEBUG_COMMON, "[%p] Resolving failed", query);
-               query->callback(query, -1, NULL);
-               query->callback = NULL;
-               return;
-       }
-
-       for (i = 0; i < array_size(addr) && he->h_addr_list[i] != NULL; i++) {
-               memset(&addr[i], 0, sizeof(addr[i]));
-               addr[i].sa.sa_family = he->h_addrtype;
-               switch (he->h_addrtype) {
-               case AF_INET:
-                       memcpy(&addr[i].sin.sin_addr,
-                              (uint8_t *)he->h_addr_list[i], he->h_length);
-                       break;
-               case AF_INET6:
-                       memcpy(&addr[i].sin6.sin6_addr,
-                              (uint8_t *)he->h_addr_list[i], he->h_length);
-                       break;
-               }
-       }
-
-       debugf(NHRP_DEBUG_COMMON, "[%p] Resolved with %d results", query,
-              (int)i);
-       query->callback(query, i, &addr[0]);
-       query->callback = NULL;
-}
-
-void resolver_resolve(struct resolver_query *query, int af,
-                     const char *hostname,
-                     void (*callback)(struct resolver_query *, int,
-                                      union sockunion *))
-{
-       if (query->callback != NULL) {
-               flog_err(
-                       EC_NHRP_RESOLVER,
-                       "Trying to resolve '%s', but previous query was not finished yet",
-                       hostname);
-               return;
-       }
-
-       debugf(NHRP_DEBUG_COMMON, "[%p] Resolving '%s'", query, hostname);
-
-       query->callback = callback;
-       ares_gethostbyname(state.channel, hostname, af, ares_address_cb, query);
-       resolver_update_timeouts(&state);
-}
index 6e2b91780f764625f109b0261b0c1460c717f4f0..fe76623ac38b7beb6d2fe64f8bdf92e5bad8efe3 100644 (file)
@@ -8,8 +8,7 @@ vtysh_scan += $(top_srcdir)/nhrpd/nhrp_vty.c
 man8 += $(MANBUILD)/nhrpd.8
 endif
 
-nhrpd_nhrpd_LDADD = lib/libfrr.la $(LIBCAP) $(CARES_LIBS)
-nhrpd_nhrpd_CFLAGS = $(AM_CFLAGS) $(CARES_CFLAGS)
+nhrpd_nhrpd_LDADD = lib/libfrr.la lib/libfrrcares.la $(LIBCAP)
 nhrpd_nhrpd_SOURCES = \
        nhrpd/linux.c \
        nhrpd/netlink_arp.c \
@@ -27,7 +26,6 @@ nhrpd_nhrpd_SOURCES = \
        nhrpd/nhrp_vc.c \
        nhrpd/nhrp_vty.c \
        nhrpd/reqid.c \
-       nhrpd/resolver.c \
        nhrpd/vici.c \
        nhrpd/zbuf.c \
        nhrpd/znl.c \
index b8957c2b00bbbab6d080810d08f79e7e8d27fb85..4ae1e499ff479c2f9907dacba2c7cc89e71ed477 100644 (file)
@@ -377,6 +377,9 @@ void vtysh_config_parse_line(void *arg, const char *line)
                                 strlen("debug route-map"))
                         == 0)
                        config = config_get(RMAP_DEBUG_NODE, line);
+               else if (strncmp(line, "debug resolver",
+                                strlen("debug resolver")) == 0)
+                       config = config_get(RESOLVER_DEBUG_NODE, line);
                else if (strncmp(line, "debug", strlen("debug")) == 0)
                        config = config_get(DEBUG_NODE, line);
                else if (strncmp(line, "password", strlen("password")) == 0
@@ -423,7 +426,7 @@ void vtysh_config_parse_line(void *arg, const char *line)
         || (I) == PREFIX_IPV6_NODE || (I) == FORWARDING_NODE                  \
         || (I) == DEBUG_NODE || (I) == AAA_NODE || (I) == VRF_DEBUG_NODE      \
         || (I) == NORTHBOUND_DEBUG_NODE || (I) == RMAP_DEBUG_NODE             \
-        || (I) == MPLS_NODE)
+        || (I) == RESOLVER_DEBUG_NODE || (I) == MPLS_NODE)
 
 /* Display configuration to file pointer. */
 void vtysh_config_dump(void)