summaryrefslogtreecommitdiff
path: root/zebra/zserv.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/zserv.c')
-rw-r--r--zebra/zserv.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/zebra/zserv.c b/zebra/zserv.c
index 0e0cc78bbe..ef289f3960 100644
--- a/zebra/zserv.c
+++ b/zebra/zserv.c
@@ -626,6 +626,7 @@ int zsend_redistribute_route(int cmd, struct zserv *client, struct prefix *p,
api_nh->type = nexthop->type;
switch (nexthop->type) {
case NEXTHOP_TYPE_BLACKHOLE:
+ api_nh->bh_type = nexthop->bh_type;
break;
case NEXTHOP_TYPE_IPV4:
api_nh->gate.ipv4 = nexthop->gate.ipv4;
@@ -1093,7 +1094,8 @@ static int zread_route_add(struct zserv *client, u_short length,
api_nh->ifindex);
break;
case NEXTHOP_TYPE_BLACKHOLE:
- route_entry_nexthop_blackhole_add(re);
+ route_entry_nexthop_blackhole_add(
+ re, api_nh->bh_type);
break;
}
@@ -1163,7 +1165,7 @@ static int zread_route_del(struct zserv *client, u_short length,
src_p = &api.src_prefix;
rib_delete(afi, api.safi, zvrf_id(zvrf), api.type, api.instance,
- api.flags, &api.prefix, src_p, NULL, 0, zvrf->table_id,
+ api.flags, &api.prefix, src_p, NULL, zvrf->table_id,
api.metric);
/* Stats */
@@ -1201,6 +1203,7 @@ static int zread_ipv4_add(struct zserv *client, u_short length,
enum lsp_types_t label_type = ZEBRA_LSP_NONE;
mpls_label_t label;
struct nexthop *nexthop;
+ enum blackhole_type bh_type = BLACKHOLE_NULL;
/* Get input stream. */
s = client->ibuf;
@@ -1264,7 +1267,7 @@ static int zread_ipv4_add(struct zserv *client, u_short length,
stream_forward_getp(s, IPV6_MAX_BYTELEN);
break;
case NEXTHOP_TYPE_BLACKHOLE:
- route_entry_nexthop_blackhole_add(re);
+ route_entry_nexthop_blackhole_add(re, bh_type);
break;
}
}
@@ -1329,7 +1332,7 @@ static int zread_ipv4_delete(struct zserv *client, u_short length,
table_id = zvrf->table_id;
rib_delete(AFI_IP, api.safi, zvrf_id(zvrf), api.type, api.instance,
- api.flags, &p, NULL, NULL, 0, table_id, 0);
+ api.flags, &p, NULL, NULL, table_id, 0);
client->v4_route_del_cnt++;
return 0;
}
@@ -1367,6 +1370,7 @@ static int zread_ipv4_route_ipv6_nexthop_add(struct zserv *client,
enum lsp_types_t label_type = ZEBRA_LSP_NONE;
mpls_label_t label;
struct nexthop *nexthop;
+ enum blackhole_type bh_type = BLACKHOLE_NULL;
/* Get input stream. */
s = client->ibuf;
@@ -1434,7 +1438,7 @@ static int zread_ipv4_route_ipv6_nexthop_add(struct zserv *client,
}
break;
case NEXTHOP_TYPE_BLACKHOLE:
- route_entry_nexthop_blackhole_add(re);
+ route_entry_nexthop_blackhole_add(re, bh_type);
break;
}
}
@@ -1516,6 +1520,7 @@ static int zread_ipv6_add(struct zserv *client, u_short length,
enum lsp_types_t label_type = ZEBRA_LSP_NONE;
mpls_label_t label;
struct nexthop *nexthop;
+ enum blackhole_type bh_type = BLACKHOLE_NULL;
/* Get input stream. */
s = client->ibuf;
@@ -1594,7 +1599,7 @@ static int zread_ipv6_add(struct zserv *client, u_short length,
}
break;
case NEXTHOP_TYPE_BLACKHOLE:
- route_entry_nexthop_blackhole_add(re);
+ route_entry_nexthop_blackhole_add(re, bh_type);
break;
}
}
@@ -1674,7 +1679,7 @@ static int zread_ipv6_delete(struct zserv *client, u_short length,
api.safi = stream_getw(s);
/* IPv4 prefix. */
- memset(&p, 0, sizeof(struct prefix_ipv6));
+ memset(&p, 0, sizeof(struct prefix));
p.family = AF_INET6;
p.prefixlen = stream_getc(s);
stream_get(&p.u.prefix6, s, PSIZE(p.prefixlen));
@@ -1689,7 +1694,7 @@ static int zread_ipv6_delete(struct zserv *client, u_short length,
src_pp = NULL;
rib_delete(AFI_IP6, api.safi, zvrf_id(zvrf), api.type, api.instance,
- api.flags, &p, src_pp, NULL, 0, client->rtm_table, 0);
+ api.flags, &p, src_pp, NULL, client->rtm_table, 0);
client->v6_route_del_cnt++;
return 0;