diff options
| author | Christian Franke <chris@opensourcerouting.org> | 2016-10-01 06:41:40 +0200 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2016-10-07 21:05:05 -0400 |
| commit | 464015fa32f89e7f128cb19917c9e347b3284d69 (patch) | |
| tree | cd2a26c1663e632240b268241fa0e3d778e1035e /ospf6d/ospf6_zebra.c | |
| parent | dc9ffce87868441da9653d1476a4307eb2ecd996 (diff) | |
ospf6d: add support for route tags
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Diffstat (limited to 'ospf6d/ospf6_zebra.c')
| -rw-r--r-- | ospf6d/ospf6_zebra.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/ospf6d/ospf6_zebra.c b/ospf6d/ospf6_zebra.c index 45165fdf2e..d24b808aaa 100644 --- a/ospf6d/ospf6_zebra.c +++ b/ospf6d/ospf6_zebra.c @@ -260,6 +260,11 @@ ospf6_zebra_read_ipv6 (int command, struct zclient *zclient, else api.metric = 0; + if (CHECK_FLAG (api.message, ZAPI_MESSAGE_TAG)) + api.tag = stream_getl (s); + else + api.tag = 0; + if (IS_OSPF6_DEBUG_ZEBRA (RECV)) { char prefixstr[PREFIX2STR_BUFFER], nexthopstr[128]; @@ -269,14 +274,14 @@ ospf6_zebra_read_ipv6 (int command, struct zclient *zclient, else snprintf (nexthopstr, sizeof (nexthopstr), "::"); - zlog_debug ("Zebra Receive route %s: %s %s nexthop %s ifindex %ld", + zlog_debug ("Zebra Receive route %s: %s %s nexthop %s ifindex %ld tag %"ROUTE_TAG_PRI, (command == ZEBRA_IPV6_ROUTE_ADD ? "add" : "delete"), - zebra_route_string(api.type), prefixstr, nexthopstr, ifindex); + zebra_route_string(api.type), prefixstr, nexthopstr, ifindex, api.tag); } if (command == ZEBRA_REDISTRIBUTE_IPV6_ADD) ospf6_asbr_redistribute_add (api.type, ifindex, (struct prefix *) &p, - api.nexthop_num, nexthop); + api.nexthop_num, nexthop, api.tag); else ospf6_asbr_redistribute_remove (api.type, ifindex, (struct prefix *) &p); @@ -468,6 +473,11 @@ ospf6_zebra_route_update (int type, struct ospf6_route *request) SET_FLAG (api.message, ZAPI_MESSAGE_METRIC); api.metric = (request->path.metric_type == 2 ? request->path.u.cost_e2 : request->path.cost); + if (request->path.tag) + { + SET_FLAG (api.message, ZAPI_MESSAGE_TAG); + api.tag = request->path.tag; + } dest = (struct prefix_ipv6 *) &request->prefix; if (type == REM) |
