summaryrefslogtreecommitdiff
path: root/ospf6d/ospf6_zebra.c
diff options
context:
space:
mode:
Diffstat (limited to 'ospf6d/ospf6_zebra.c')
-rw-r--r--ospf6d/ospf6_zebra.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/ospf6d/ospf6_zebra.c b/ospf6d/ospf6_zebra.c
index fd87c5a56f..c3b8739532 100644
--- a/ospf6d/ospf6_zebra.c
+++ b/ospf6d/ospf6_zebra.c
@@ -229,13 +229,13 @@ ospf6_zebra_read_ipv6 (int command, struct zclient *zclient,
/* Type, flags, message. */
api.type = stream_getc (s);
api.instance = stream_getw (s);
- api.flags = stream_getc (s);
+ api.flags = stream_getl (s);
api.message = stream_getc (s);
/* IPv6 prefix. */
memset (&p, 0, sizeof (struct prefix_ipv6));
p.family = AF_INET6;
- p.prefixlen = stream_getc (s);
+ p.prefixlen = MIN(IPV6_MAX_PREFIXLEN, stream_getc (s));
stream_get (&p.prefix, s, PSIZE (p.prefixlen));
/* Nexthop, ifindex, distance, metric. */
@@ -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);
@@ -444,6 +449,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)
@@ -653,12 +663,8 @@ ospf6_zebra_init (struct thread_master *master)
zclient->interface_down = ospf6_zebra_if_state_update;
zclient->interface_address_add = ospf6_zebra_if_address_update_add;
zclient->interface_address_delete = ospf6_zebra_if_address_update_delete;
- zclient->ipv4_route_add = NULL;
- zclient->ipv4_route_delete = NULL;
zclient->redistribute_route_ipv4_add = NULL;
zclient->redistribute_route_ipv4_del = NULL;
- zclient->ipv6_route_add = ospf6_zebra_read_ipv6;
- zclient->ipv6_route_delete = ospf6_zebra_read_ipv6;
zclient->redistribute_route_ipv6_add = ospf6_zebra_read_ipv6;
zclient->redistribute_route_ipv6_del = ospf6_zebra_read_ipv6;
@@ -670,7 +676,6 @@ ospf6_zebra_init (struct thread_master *master)
/* Install command element for zebra node. */
install_element (VIEW_NODE, &show_zebra_cmd);
- install_element (ENABLE_NODE, &show_zebra_cmd);
install_default (ZEBRA_NODE);
install_element (ZEBRA_NODE, &redistribute_ospf6_cmd);
install_element (ZEBRA_NODE, &no_redistribute_ospf6_cmd);