]> git.proxmox.com Git - mirror_frr.git/blobdiff - nhrpd/resolver.c
zebra: reduce rib workqueue retry timeout
[mirror_frr.git] / nhrpd / resolver.c
index 6349224adcb241448ed38f5e427c7e94921e6242..830f0e1c84f8d62f168ff8b3d36073430334420f 100644 (file)
@@ -7,12 +7,19 @@
  * (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;
@@ -164,7 +171,7 @@ static void ares_address_cb(void *arg, int status, int timeouts,
                return;
        }
 
-       for (i = 0; he->h_addr_list[i] != NULL && i < ZEBRA_NUM_OF(addr); i++) {
+       for (i = 0; i < ZEBRA_NUM_OF(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) {
@@ -191,7 +198,8 @@ void resolver_resolve(struct resolver_query *query, int af,
                                       union sockunion *))
 {
        if (query->callback != NULL) {
-               zlog_err(
+               flog_err(
+                       EC_NHRP_RESOLVER,
                        "Trying to resolve '%s', but previous query was not finished yet",
                        hostname);
                return;