Commits

Everton Marques authored and David Lamparter committed c77f01b9c90
PIM_ZCLIENT_DEBUG enables zclient_socket() / zclient_socket_un() debug
No tags

pimd/pim_zlookup.c

Modified
44 44 {
45 45 struct zclient *zlookup;
46 46
47 47 zlookup = THREAD_ARG(t);
48 48 zlookup->t_connect = NULL;
49 49
50 50 if (zlookup->sock >= 0) {
51 51 return 0;
52 52 }
53 53
54 +#ifdef PIM_ZCLIENT_DEBUG
55 +
54 56 #ifdef HAVE_TCP_ZEBRA
55 57 zlog_debug("%s: FIXME blocking connect: zclient_socket()",
56 58 __PRETTY_FUNCTION__);
57 59 zlookup->sock = zclient_socket();
58 60 if (zlookup->sock < 0) {
59 61 zlog_warn("%s: failure connecting TCP socket %s,%d",
60 62 __PRETTY_FUNCTION__, "127.0.0.1", ZEBRA_PORT);
61 63 }
62 64 else if (zclient_debug) {
63 65 zlog_notice("%s: connected TCP socket %s,%d",
70 72 if (zlookup->sock < 0) {
71 73 zlog_warn("%s: failure connecting UNIX socket %s",
72 74 __PRETTY_FUNCTION__, ZEBRA_SERV_PATH);
73 75 }
74 76 else if (zclient_debug) {
75 77 zlog_notice("%s: connected UNIX socket %s",
76 78 __PRETTY_FUNCTION__, ZEBRA_SERV_PATH);
77 79 }
78 80 #endif /* HAVE_TCP_ZEBRA */
79 81
82 +#else
83 +
84 + zlog_debug("%s: FIXME blocking connect: zclient_socket_connect()",
85 + __PRETTY_FUNCTION__);
86 + if (zclient_socket_connect(zlookup) < 0) {
87 + zlog_warn("%s: failure connecting zclient socket",
88 + __PRETTY_FUNCTION__);
89 + }
90 +
91 +#endif /* PIM_ZCLIENT_DEBUG */
92 +
80 93 zassert(!zlookup->t_connect);
81 94 if (zlookup->sock < 0) {
82 95 /* Since last connect failed, retry within 10 secs */
83 96 zclient_lookup_sched(zlookup, 10);
84 97 return -1;
85 98 }
86 99
87 100 return 0;
88 101 }
89 102

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut