Browse Source

PIM_ZCLIENT_DEBUG enables zclient_socket() / zclient_socket_un() debug

Everton Marques 6 years ago
parent
commit
c77f01b9c9
1 changed files with 13 additions and 0 deletions
  1. 13 0
      pimd/pim_zlookup.c

+ 13 - 0
pimd/pim_zlookup.c

@@ -51,6 +51,8 @@ static int zclient_lookup_connect(struct thread *t)
     return 0;
   }
 
+#ifdef PIM_ZCLIENT_DEBUG
+
 #ifdef HAVE_TCP_ZEBRA
   zlog_debug("%s: FIXME blocking connect: zclient_socket()",
 	     __PRETTY_FUNCTION__);
@@ -77,6 +79,17 @@ static int zclient_lookup_connect(struct thread *t)
   }
 #endif /* HAVE_TCP_ZEBRA */
 
+#else
+
+  zlog_debug("%s: FIXME blocking connect: zclient_socket_connect()",
+	     __PRETTY_FUNCTION__);
+  if (zclient_socket_connect(zlookup) < 0) {
+    zlog_warn("%s: failure connecting zclient socket",
+	      __PRETTY_FUNCTION__);
+  }
+
+#endif /* PIM_ZCLIENT_DEBUG */
+
   zassert(!zlookup->t_connect);
   if (zlookup->sock < 0) {
     /* Since last connect failed, retry within 10 secs */