diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-02-10 01:27:52 +0100 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-02-23 20:45:57 +0100 |
commit | 28610f7e444dbb2ea4175582f84e566a6645927b (patch) | |
tree | 4af0dfe041b19506f2da76ee05098d9fb6bef41b | |
parent | Merge pull request #1793 from qlyoung/stylechecker (diff) | |
download | frr-28610f7e444dbb2ea4175582f84e566a6645927b.tar.xz frr-28610f7e444dbb2ea4175582f84e566a6645927b.zip |
*: Add tableid the route entry was sent to
Add for the southbound pass back the route entries tableid
used for installation.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
-rw-r--r-- | eigrpd/eigrp_zebra.c | 3 | ||||
-rw-r--r-- | lib/zclient.c | 2 | ||||
-rw-r--r-- | lib/zclient.h | 1 | ||||
-rw-r--r-- | sharpd/sharp_zebra.c | 3 | ||||
-rw-r--r-- | zebra/zebra_rib.c | 10 | ||||
-rw-r--r-- | zebra/zserv.c | 15 | ||||
-rw-r--r-- | zebra/zserv.h | 3 |
7 files changed, 20 insertions, 17 deletions
diff --git a/eigrpd/eigrp_zebra.c b/eigrpd/eigrp_zebra.c index 3759c6414..513fda06f 100644 --- a/eigrpd/eigrp_zebra.c +++ b/eigrpd/eigrp_zebra.c @@ -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, ¬e)) + if (!zapi_route_notify_decode(zclient->ibuf, &p, &table, ¬e)) return -1; return 0; diff --git a/lib/zclient.c b/lib/zclient.c index 714888a3f..fc4d37458 100644 --- a/lib/zclient.c +++ b/lib/zclient.c @@ -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; diff --git a/lib/zclient.h b/lib/zclient.h index d8a70c6cf..21785abfb 100644 --- a/lib/zclient.h +++ b/lib/zclient.h @@ -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, diff --git a/sharpd/sharp_zebra.c b/sharpd/sharp_zebra.c index 78e8cf0ad..b39fc47d3 100644 --- a/sharpd/sharp_zebra.c +++ b/sharpd/sharp_zebra.c @@ -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, ¬e)) + if (!zapi_route_notify_decode(zclient->ibuf, &p, &table, ¬e)) return -1; installed_routes++; diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 967bc9285..1ba85f0ea 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -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 diff --git a/zebra/zserv.c b/zebra/zserv.c index b3b1fa79e..425a9549e 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -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, ¬e, 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); diff --git a/zebra/zserv.h b/zebra/zserv.h index 7d5f6b454..204481622 100644 --- a/zebra/zserv.h +++ b/zebra/zserv.h @@ -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 *, |