#include "zebra/zapi_msg.h"
#include "zebra/zebra_memory.h"
#include "zebra/zebra_vxlan.h"
+#include "zebra/zebra_errors.h"
#define ZEBRA_PTM_SUPPORT
for (rn = route_top(table); rn; rn = srcdest_route_next(rn))
RNODE_FOREACH_RE (rn, newre) {
- struct prefix *dst_p, *src_p;
+ const struct prefix *dst_p, *src_p;
char buf[PREFIX_STRLEN];
srcdest_rnode_prefixes(rn, &dst_p, &src_p);
/* Either advertise a route for redistribution to registered clients or */
/* withdraw redistribution if add cannot be done for client */
-void redistribute_update(struct prefix *p, struct prefix *src_p,
+void redistribute_update(const struct prefix *p, const struct prefix *src_p,
struct route_entry *re, struct route_entry *prev_re)
{
struct listnode *node, *nnode;
afi = family2afi(p->family);
if (!afi) {
- zlog_warn("%s: Unknown AFI/SAFI prefix received\n",
+ flog_warn(EC_ZEBRA_REDISTRIBUTE_UNKNOWN_AF,
+ "%s: Unknown AFI/SAFI prefix received\n",
__FUNCTION__);
return;
}
}
}
-void redistribute_delete(struct prefix *p, struct prefix *src_p,
+void redistribute_delete(const struct prefix *p, const struct prefix *src_p,
struct route_entry *re)
{
struct listnode *node, *nnode;
afi = family2afi(p->family);
if (!afi) {
- zlog_warn("%s: Unknown AFI/SAFI prefix received\n",
+ flog_warn(EC_ZEBRA_REDISTRIBUTE_UNKNOWN_AF,
+ "%s: Unknown AFI/SAFI prefix received\n",
__FUNCTION__);
return;
}
__func__, zebra_route_string(client->proto), afi,
zebra_route_string(type), zvrf_id(zvrf), instance);
- if (afi == 0 || afi > AFI_MAX) {
- zlog_warn("%s: Specified afi %d does not exist",
+ if (afi == 0 || afi >= AFI_MAX) {
+ flog_warn(EC_ZEBRA_REDISTRIBUTE_UNKNOWN_AF,
+ "%s: Specified afi %d does not exist",
__PRETTY_FUNCTION__, afi);
return;
}
if (type == 0 || type >= ZEBRA_ROUTE_MAX) {
- zlog_warn("%s: Specified Route Type %d does not exist",
- __PRETTY_FUNCTION__, type);
+ zlog_debug("%s: Specified Route Type %d does not exist",
+ __PRETTY_FUNCTION__, type);
return;
}
STREAM_GETC(msg, type);
STREAM_GETW(msg, instance);
- if (afi == 0 || afi > AFI_MAX) {
- zlog_warn("%s: Specified afi %d does not exist",
+ if (afi == 0 || afi >= AFI_MAX) {
+ flog_warn(EC_ZEBRA_REDISTRIBUTE_UNKNOWN_AF,
+ "%s: Specified afi %d does not exist",
__PRETTY_FUNCTION__, afi);
return;
}
if (type == 0 || type >= ZEBRA_ROUTE_MAX) {
- zlog_warn("%s: Specified Route Type %d does not exist",
- __PRETTY_FUNCTION__, type);
+ zlog_debug("%s: Specified Route Type %d does not exist",
+ __PRETTY_FUNCTION__, type);
return;
}
}
if (!CHECK_FLAG(ifc->conf, ZEBRA_IFC_REAL))
- zlog_warn(
+ flog_warn(
+ EC_ZEBRA_ADVERTISING_UNUSABLE_ADDR,
"WARNING: advertising address to clients that is not yet usable.");
zebra_vxlan_add_del_gw_macip(ifp, ifc->address, 1);
rib_delete(afi, SAFI_UNICAST, re->vrf_id, ZEBRA_ROUTE_TABLE, re->table,
re->flags, &p, NULL, re->ng.nexthop,
- zebrad.rtm_table_default, re->metric, false);
+ zebrad.rtm_table_default, re->metric, re->distance, false);
return 0;
}
return write;
}
-void zebra_import_table_rm_update()
+void zebra_import_table_rm_update(const char *rmap)
{
afi_t afi;
int i;
continue;
rmap_name = zebra_get_import_table_route_map(afi, i);
- if (!rmap_name)
- return;
-
+ if ((!rmap_name) || (strcmp(rmap_name, rmap) != 0))
+ continue;
table = zebra_vrf_other_route_table(afi, i,
VRF_DEFAULT);
for (rn = route_top(table); rn; rn = route_next(rn)) {