[dev] Not able to receive message in zebra from bgp

Donald Sharp sharpd at cumulusnetworks.com
Sun May 26 10:12:22 EDT 2019


1) All you need to do in bgp is this:

diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c
index a45480fdc..b3ac4a8e0 100644
--- a/bgpd/bgp_zebra.c
+++ b/bgpd/bgp_zebra.c
@@ -2703,15 +2703,25 @@ stream_failure:         /* for STREAM_GETX */
        return;
 }

+static int bgp_zebra_route_notify_owner(ZAPI_CALLBACK_ARGS)
+{
+       zlog_debug("Route install received");
+
+       return 0;
+}
+
 extern struct zebra_privs_t bgpd_privs;

 void bgp_zebra_init(struct thread_master *master, unsigned short instance)
 {
+       struct zclient_options opt = {.receive_notify = true};
+
        zclient_num_connects = 0;

        /* Set default values. */
-       zclient = zclient_new(master, &zclient_options_default);
+       zclient = zclient_new(master, &opt);
        zclient_init(zclient, ZEBRA_ROUTE_BGP, 0, &bgpd_privs);
+       zclient->route_notify_owner = bgp_zebra_route_notify_owner;
        zclient->zebra_connected = bgp_zebra_connected;
        zclient->router_id_update = bgp_router_id_update;
        zclient->interface_add = bgp_interface_add;

look at `sharpd/sharp_zebra.c` for further clarifications if you need them.

2) look at the zlog_backtrace() function

donald
On Sun, May 26, 2019 at 5:21 AM sudhanshu kumar <sudhanshu22 at gmail.com> wrote:
>
> Hi,
> 1. I am sending a message from BGP to zebra to set a client variable in zebra. (notify_owner inside structure zserv). For this, I expect that bgp to zebra connection should be up. So, I added code to send message from bgp to zebra in bgp_zebra_connected(). But it looks like message is not getting received in zebra or getting dropped. What is the correct place for sending message from bgp to zebra immediately when connection is up ?
>
> 2. Is there any way to print the callstack inside bgp without breaking the bgp code (something like software assert).
>
> Thanks,
> Sudhanshu
> _______________________________________________
> dev mailing list
> dev at lists.frrouting.org
> https://lists.frrouting.org/listinfo/dev



More information about the dev mailing list