summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/zclient.c21
-rw-r--r--lib/zebra.h3
2 files changed, 23 insertions, 1 deletions
diff --git a/lib/zclient.c b/lib/zclient.c
index 5815eaa8..12d113e7 100644
--- a/lib/zclient.c
+++ b/lib/zclient.c
@@ -318,6 +318,25 @@ zebra_message_send (struct zclient *zclient, int command)
return zclient_send_message(zclient);
}
+static int
+zebra_hello_send (struct zclient *zclient)
+{
+ struct stream *s;
+
+ if (zclient->redist_default)
+ {
+ s = zclient->obuf;
+ stream_reset (s);
+
+ zclient_create_header (s, ZEBRA_HELLO);
+ stream_putc (s, zclient->redist_default);
+ stream_putw_at (s, 0, stream_get_endp (s));
+ return zclient_send_message(zclient);
+ }
+
+ return 0;
+}
+
/* Make connection to zebra daemon. */
int
zclient_start (struct zclient *zclient)
@@ -359,6 +378,8 @@ zclient_start (struct zclient *zclient)
/* Create read thread. */
zclient_event (ZCLIENT_READ, zclient);
+ zebra_hello_send (zclient);
+
/* We need router-id information. */
zebra_message_send (zclient, ZEBRA_ROUTER_ID_ADD);
diff --git a/lib/zebra.h b/lib/zebra.h
index 4b4c7c00..ab072d6e 100644
--- a/lib/zebra.h
+++ b/lib/zebra.h
@@ -417,7 +417,8 @@ struct in_pktinfo
#define ZEBRA_ROUTER_ID_ADD 20
#define ZEBRA_ROUTER_ID_DELETE 21
#define ZEBRA_ROUTER_ID_UPDATE 22
-#define ZEBRA_MESSAGE_MAX 23
+#define ZEBRA_HELLO 23
+#define ZEBRA_MESSAGE_MAX 24
/* Marker value used in new Zserv, in the byte location corresponding
* the command value in the old zserv header. To allow old and new