summaryrefslogtreecommitdiff
path: root/zebra/zapi_msg.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/zapi_msg.c')
-rw-r--r--zebra/zapi_msg.c45
1 files changed, 24 insertions, 21 deletions
diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c
index 4d0e34561a..43bad5522c 100644
--- a/zebra/zapi_msg.c
+++ b/zebra/zapi_msg.c
@@ -580,7 +580,7 @@ int zsend_redistribute_route(int cmd, struct zserv *client,
memcpy(&api.src_prefix, src_p, sizeof(api.src_prefix));
}
- for (nexthop = re->nhe->nhg->nexthop;
+ for (nexthop = re->nhe->nhg.nexthop;
nexthop; nexthop = nexthop->next) {
if (!CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_ACTIVE))
continue;
@@ -689,7 +689,7 @@ static int zsend_ipv4_nexthop_lookup_mrib(struct zserv *client,
* nexthop we are looking up. Therefore, we will just iterate
* over the top chain of nexthops.
*/
- for (nexthop = re->nhe->nhg->nexthop; nexthop;
+ for (nexthop = re->nhe->nhg.nexthop; nexthop;
nexthop = nexthop->next)
if (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_ACTIVE))
num += zserv_encode_nexthop(s, nexthop);
@@ -1823,17 +1823,17 @@ static void zread_mpls_labels_add(ZAPI_HANDLER_ARGS)
return;
for (int i = 0; i < zl.nexthop_num; i++) {
- struct zapi_nexthop_label *znh;
+ struct zapi_nexthop *znh;
znh = &zl.nexthops[i];
- mpls_lsp_install(zvrf, zl.type, zl.local_label, 1, &znh->label,
- znh->type, &znh->address, znh->ifindex);
+ mpls_lsp_install(zvrf, zl.type, zl.local_label, 1, znh->labels,
+ znh->type, &znh->gate, znh->ifindex);
if (CHECK_FLAG(zl.message, ZAPI_LABELS_FTN))
mpls_ftn_update(1, zvrf, zl.type, &zl.route.prefix,
- znh->type, &znh->address, znh->ifindex,
+ znh->type, &znh->gate, znh->ifindex,
zl.route.type, zl.route.instance,
- znh->label);
+ znh->labels[0]);
}
}
@@ -1866,19 +1866,20 @@ static void zread_mpls_labels_delete(ZAPI_HANDLER_ARGS)
if (zl.nexthop_num > 0) {
for (int i = 0; i < zl.nexthop_num; i++) {
- struct zapi_nexthop_label *znh;
+ struct zapi_nexthop *znh;
znh = &zl.nexthops[i];
mpls_lsp_uninstall(zvrf, zl.type, zl.local_label,
- znh->type, &znh->address,
+ znh->type, &znh->gate,
znh->ifindex);
if (CHECK_FLAG(zl.message, ZAPI_LABELS_FTN))
mpls_ftn_update(0, zvrf, zl.type,
&zl.route.prefix, znh->type,
- &znh->address, znh->ifindex,
+ &znh->gate, znh->ifindex,
zl.route.type,
- zl.route.instance, znh->label);
+ zl.route.instance,
+ znh->labels[0]);
}
} else {
mpls_lsp_uninstall_all_vrf(zvrf, zl.type, zl.local_label);
@@ -1924,17 +1925,18 @@ static void zread_mpls_labels_replace(ZAPI_HANDLER_ARGS)
zl.route.type, zl.route.instance);
for (int i = 0; i < zl.nexthop_num; i++) {
- struct zapi_nexthop_label *znh;
+ struct zapi_nexthop *znh;
znh = &zl.nexthops[i];
- mpls_lsp_install(zvrf, zl.type, zl.local_label, 1, &znh->label,
- znh->type, &znh->address, znh->ifindex);
+ mpls_lsp_install(zvrf, zl.type, zl.local_label,
+ 1, znh->labels, znh->type,
+ &znh->gate, znh->ifindex);
if (CHECK_FLAG(zl.message, ZAPI_LABELS_FTN)) {
mpls_ftn_update(1, zvrf, zl.type, &zl.route.prefix,
- znh->type, &znh->address, znh->ifindex,
+ znh->type, &znh->gate, znh->ifindex,
zl.route.type, zl.route.instance,
- znh->label);
+ znh->labels[0]);
}
}
}
@@ -1946,6 +1948,7 @@ static void zread_table_manager_connect(struct zserv *client,
struct stream *s;
uint8_t proto;
uint16_t instance;
+ struct vrf *vrf = vrf_lookup_by_id(vrf_id);
s = msg;
@@ -1961,8 +1964,9 @@ static void zread_table_manager_connect(struct zserv *client,
zsend_table_manager_connect_response(client, vrf_id, 1);
return;
}
- zlog_notice("client %d with vrf %u instance %u connected as %s",
- client->sock, vrf_id, instance, zebra_route_string(proto));
+ zlog_notice("client %d with vrf %s(%u) instance %u connected as %s",
+ client->sock, VRF_LOGNAME(vrf), vrf_id, instance,
+ zebra_route_string(proto));
client->proto = proto;
client->instance = instance;
@@ -2408,15 +2412,14 @@ static inline void zread_rule(ZAPI_HANDLER_ARGS)
|| zpr.rule.filter.src_ip.family == AF_INET6)) {
zlog_warn(
"Unsupported PBR source IP family: %s (%" PRIu8
- ")\n",
+ ")",
family2str(zpr.rule.filter.src_ip.family),
zpr.rule.filter.src_ip.family);
return;
}
if (!(zpr.rule.filter.dst_ip.family == AF_INET
|| zpr.rule.filter.dst_ip.family == AF_INET6)) {
- zlog_warn("Unsupported PBR IP family: %s (%" PRIu8
- ")\n",
+ zlog_warn("Unsupported PBR IP family: %s (%" PRIu8 ")",
family2str(zpr.rule.filter.dst_ip.family),
zpr.rule.filter.dst_ip.family);
return;