diff options
author | Vyacheslav Trushkin <me@dogonthesun.net> | 2011-12-11 18:48:47 +0400 |
---|---|---|
committer | Denis Ovsienko <infrastation@yandex.ru> | 2012-01-02 17:27:19 +0400 |
commit | 89e9f82e0b717c0e39bbffa104f9d9f817c19b46 (patch) | |
tree | 93bf15e1698b686741ee6574f65a3e7a5155dc2c /lib/zclient.c | |
parent | 07bb964ef11d34235570427cd9bc4111956e31b7 (diff) |
zebra: ZEBRA_HELLO and mopping up routes (BZ#448)
ZEBRA_HELLO message is used by routing daemons to inform zebra
what type of routes daemon will be announcing to zebra. Also
zebra uses route_type_oaths array to track which daemon announces
which protocol. Zebra mops up routes if daemon didn't for some
reason.
Diffstat (limited to 'lib/zclient.c')
-rw-r--r-- | lib/zclient.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/zclient.c b/lib/zclient.c index a5d5b7ff..37ee2420 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); |