]> git.puffer.fish Git - matthieu/frr.git/commitdiff
*: Add tableid the route entry was sent to
authorDonald Sharp <sharpd@cumulusnetworks.com>
Sat, 10 Feb 2018 00:27:52 +0000 (19:27 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 23 Feb 2018 19:45:57 +0000 (14:45 -0500)
Add for the southbound pass back the route entries tableid
used for installation.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
eigrpd/eigrp_zebra.c
lib/zclient.c
lib/zclient.h
sharpd/sharp_zebra.c
zebra/zebra_rib.c
zebra/zserv.c
zebra/zserv.h

index 3759c6414838c8cba7570c4d0ca1e54dc05011ca..513fda06f309dc85d96490c856d0e48908efc549 100644 (file)
@@ -99,8 +99,9 @@ static int eigrp_zebra_notify_owner(int command, struct zclient *zclient,
 {
        struct prefix p;
        enum zapi_route_notify_owner note;
+       uint32_t table;
 
-       if (!zapi_route_notify_decode(zclient->ibuf, &p, &note))
+       if (!zapi_route_notify_decode(zclient->ibuf, &p, &table, &note))
                return -1;
 
        return 0;
index 714888a3f3f260625fe4621c5de3828e38cd2e64..fc4d37458c0a290793f12302f787ccf33a835675 100644 (file)
@@ -1210,6 +1210,7 @@ stream_failure:
 }
 
 bool zapi_route_notify_decode(struct stream *s, struct prefix *p,
+                             uint32_t *tableid,
                              enum zapi_route_notify_owner *note)
 {
        STREAM_GET(note, s, sizeof(*note));
@@ -1218,6 +1219,7 @@ bool zapi_route_notify_decode(struct stream *s, struct prefix *p,
        STREAM_GETC(s, p->prefixlen);
        STREAM_GET(&p->u.prefix, s,
                   PSIZE(p->prefixlen));
+       STREAM_GETL(s, *tableid);
 
        return true;
 
index d8a70c6cf339a263774152eee3f5dfc59b946c0d..21785abfbcf95cf2a3f8722928b8d7e47d4b9e95 100644 (file)
@@ -513,6 +513,7 @@ extern int zclient_send_rnh(struct zclient *zclient, int command,
 extern int zapi_route_encode(u_char, struct stream *, struct zapi_route *);
 extern int zapi_route_decode(struct stream *, struct zapi_route *);
 bool zapi_route_notify_decode(struct stream *s, struct prefix *p,
+                             uint32_t *tableid,
                              enum zapi_route_notify_owner *note);
 extern struct nexthop *nexthop_from_zapi_nexthop(struct zapi_nexthop *znh);
 extern bool zapi_nexthop_update_decode(struct stream *s,
index 78e8cf0adca4dd1363fc3f3c0d1e25662f51eb7a..b39fc47d3dff721256e327fb9262150dbfce9cc7 100644 (file)
@@ -136,8 +136,9 @@ static int notify_owner(int command, struct zclient *zclient,
 {
        struct prefix p;
        enum zapi_route_notify_owner note;
+       uint32_t table;
 
-       if (!zapi_route_notify_decode(zclient->ibuf, &p, &note))
+       if (!zapi_route_notify_decode(zclient->ibuf, &p, &table, &note))
                return -1;
 
        installed_routes++;
index 967bc92850cb9d5282adf670fd15dc26ac77f009..1ba85f0ea25bce729208d2a5e70b78e7cb6eb5dc 100644 (file)
@@ -1033,8 +1033,7 @@ void kernel_route_rib_pass_fail(struct route_node *rn, struct prefix *p,
                        else
                                UNSET_FLAG(nexthop->flags, NEXTHOP_FLAG_FIB);
                }
-               zsend_route_notify_owner(re->type, re->instance, re->vrf_id,
-                                        p, ZAPI_ROUTE_INSTALLED);
+               zsend_route_notify_owner(re, p, ZAPI_ROUTE_INSTALLED);
                break;
        case SOUTHBOUND_INSTALL_FAILURE:
                /*
@@ -1044,8 +1043,7 @@ void kernel_route_rib_pass_fail(struct route_node *rn, struct prefix *p,
                 */
                dest->selected_fib = re;
 
-               zsend_route_notify_owner(re->type, re->instance, re->vrf_id,
-                                        p, ZAPI_ROUTE_FAIL_INSTALL);
+               zsend_route_notify_owner(re, p, ZAPI_ROUTE_FAIL_INSTALL);
                zlog_warn("%u:%s: Route install failed", re->vrf_id,
                          prefix2str(p, buf, sizeof(buf)));
                break;
@@ -1113,9 +1111,7 @@ void rib_install_kernel(struct route_node *rn, struct route_entry *re,
         * know that they've lost
         */
        if (old && old != re)
-               zsend_route_notify_owner(old->type, old->instance,
-                                        old->vrf_id, p,
-                                        ZAPI_ROUTE_BETTER_ADMIN_WON);
+               zsend_route_notify_owner(old, p, ZAPI_ROUTE_BETTER_ADMIN_WON);
 
        /*
         * Make sure we update the FPM any time we send new information to
index b3b1fa79e9ba89880ba1bcecf965cdbbad1fa398..425a9549e65ccfcaa9e9df403abc50b877b6d8b3 100644 (file)
@@ -978,21 +978,22 @@ static int zsend_ipv4_nexthop_lookup_mrib(struct zserv *client,
        return zebra_server_send_message(client);
 }
 
-int zsend_route_notify_owner(u_char proto, u_short instance,
-                            vrf_id_t vrf_id, struct prefix *p,
+int zsend_route_notify_owner(struct route_entry *re, struct prefix *p,
                             enum zapi_route_notify_owner note)
 {
        struct zserv *client;
        struct stream *s;
        uint8_t blen;
 
-       client = zebra_find_client(proto, instance);
+       client = zebra_find_client(re->type, re->instance);
        if (!client || !client->notify_owner) {
                if (IS_ZEBRA_DEBUG_PACKET) {
                        char buff[PREFIX_STRLEN];
 
-                       zlog_debug("Not Notifying Owner: %u about prefix %s",
-                                  proto, prefix2str(p, buff, sizeof(buff)));
+                       zlog_debug(
+                               "Not Notifying Owner: %u about prefix %s(%u)",
+                               re->type, prefix2str(p, buff, sizeof(buff)),
+                               re->table);
                }
                return 0;
        }
@@ -1000,7 +1001,7 @@ int zsend_route_notify_owner(u_char proto, u_short instance,
        s = client->obuf;
        stream_reset(s);
 
-       zclient_create_header(s, ZEBRA_ROUTE_NOTIFY_OWNER, vrf_id);
+       zclient_create_header(s, ZEBRA_ROUTE_NOTIFY_OWNER, re->vrf_id);
 
        stream_put(s, &note, sizeof(note));
 
@@ -1010,6 +1011,8 @@ int zsend_route_notify_owner(u_char proto, u_short instance,
        stream_putc(s, p->prefixlen);
        stream_put(s, &p->u.prefix, blen);
 
+       stream_putl(s, re->table);
+
        stream_putw_at(s, 0, stream_get_endp(s));
 
        return zebra_server_send_message(client);
index 7d5f6b45437f203c23c6b3f7d1e8e1e27239cb11..20448162270f3595fae43de53dee951a433426c6 100644 (file)
@@ -175,8 +175,7 @@ extern int zsend_interface_vrf_update(struct zserv *, struct interface *,
 extern int zsend_interface_link_params(struct zserv *, struct interface *);
 extern int zsend_pw_update(struct zserv *, struct zebra_pw *);
 
-extern int zsend_route_notify_owner(u_char proto, u_short instance,
-                                   vrf_id_t vrf_id, struct prefix *p,
+extern int zsend_route_notify_owner(struct route_entry *re, struct prefix *p,
                                    enum zapi_route_notify_owner note);
 
 extern void zserv_nexthop_num_warn(const char *, const struct prefix *,