if ((rip_enable_if_lookup(ifc->ifp->name) >= 0) ||
(rip_enable_network_lookup2(ifc) >= 0))
rip_redistribute_add(ZEBRA_ROUTE_CONNECT, RIP_ROUTE_INTERFACE,
- &address, ifc->ifp->ifindex, NULL, 0, 0);
+ &address, ifc->ifp->ifindex, NULL, 0, 0, 0);
}
(rip_enable_network_lookup2(connected) >= 0))
rip_redistribute_add (ZEBRA_ROUTE_CONNECT, RIP_ROUTE_INTERFACE,
&address, connected->ifp->ifindex,
- NULL, 0, 0);
+ NULL, 0, 0, 0);
} else
{
rip_redistribute_delete (ZEBRA_ROUTE_CONNECT, RIP_ROUTE_INTERFACE,
if (rip_redistribute_check (ZEBRA_ROUTE_CONNECT))
rip_redistribute_add (ZEBRA_ROUTE_CONNECT, RIP_ROUTE_REDISTRIBUTE,
&address, connected->ifp->ifindex,
- NULL, 0, 0);
+ NULL, 0, 0, 0);
}
}
}
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);
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_REDISTRIBUTE_IPV4_ADD)
rip_redistribute_add (api.type, RIP_ROUTE_REDISTRIBUTE, &p, ifindex,
- &nexthop, api.metric, api.distance);
+ &nexthop, api.metric, api.distance, api.tag);
else if (command == ZEBRA_REDISTRIBUTE_IPV4_DEL)
rip_redistribute_delete (api.type, RIP_ROUTE_REDISTRIBUTE, &p, ifindex);
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;
void
rip_redistribute_add (int type, int sub_type, struct prefix_ipv4 *p,
ifindex_t ifindex, struct in_addr *nexthop,
- unsigned int metric, unsigned char distance)
+ unsigned int metric, unsigned char distance,
+ route_tag_t tag)
{
int ret;
struct route_node *rp = NULL;
newinfo.metric = 1;
newinfo.external_metric = metric;
newinfo.distance = distance;
+ if (tag <= UINT16_MAX) /* RIP only supports 16 bit tags */
+ newinfo.tag = tag;
newinfo.rp = rp;
if (nexthop)
newinfo.nexthop = *nexthop;
node->info = (void *)1;
- rip_redistribute_add (ZEBRA_ROUTE_RIP, RIP_ROUTE_STATIC, &p, 0, NULL, 0, 0);
+ rip_redistribute_add (ZEBRA_ROUTE_RIP, RIP_ROUTE_STATIC, &p, 0, NULL, 0, 0, 0);
return CMD_SUCCESS;
}
extern int rip_redistribute_check (int);
extern void rip_redistribute_add (int, int, struct prefix_ipv4 *, ifindex_t,
- struct in_addr *, unsigned int, unsigned char);
+ struct in_addr *, unsigned int, unsigned char,
+ route_tag_t);
extern void rip_redistribute_delete (int, int, struct prefix_ipv4 *, ifindex_t);
extern void rip_redistribute_withdraw (int);
extern void rip_zebra_ipv4_add (struct route_node *);