ripd: add support for route tags
diff --git a/ripd/rip_zebra.c b/ripd/rip_zebra.c
index 2670ff7..0b51af5 100644
--- a/ripd/rip_zebra.c
+++ b/ripd/rip_zebra.c
@@ -90,6 +90,12 @@
api.distance = rinfo->distance;
}
+ if (rinfo->tag)
+ {
+ SET_FLAG (api.message, ZAPI_MESSAGE_TAG);
+ api.tag = rinfo->tag;
+ }
+
zapi_ipv4_route (cmd, zclient,
(struct prefix_ipv4 *)&rp->p, &api);
@@ -173,11 +179,16 @@
else
api.metric = 0;
+ if (CHECK_FLAG (api.message, ZAPI_MESSAGE_TAG))
+ api.tag = stream_getl (s);
+ else
+ api.tag = 0;
+
/* Then fetch IPv4 prefixes. */
if (command == ZEBRA_IPV4_ROUTE_ADD)
rip_redistribute_add (api.type, RIP_ROUTE_REDISTRIBUTE, &p, ifindex,
- &nexthop, api.metric, api.distance);
- else
+ &nexthop, api.metric, api.distance, api.tag);
+ else
rip_redistribute_delete (api.type, RIP_ROUTE_REDISTRIBUTE, &p, ifindex);
return 0;
@@ -612,7 +623,7 @@
rip->default_information = 1;
rip_redistribute_add (ZEBRA_ROUTE_RIP, RIP_ROUTE_DEFAULT, &p, 0,
- NULL, 0, 0);
+ NULL, 0, 0, 0);
}
return CMD_SUCCESS;