return zclient_route_send(ZEBRA_ROUTE_DELETE, zclient, &api);
SET_FLAG(api.flags, ZEBRA_FLAG_ALLOW_RECURSION);
- SET_FLAG(api.flags, ZEBRA_FLAG_SEG6LOCAL_ROUTE);
SET_FLAG(api.message, ZAPI_MESSAGE_NEXTHOP);
nh.type = NEXTHOP_TYPE_IFINDEX;
nh.ifindex = oif;
+ SET_FLAG(nh.flags, ZAPI_NEXTHOP_FLAG_SEG6LOCAL);
nexthop_add_srv6_seg6local(&nh, action, context);
zapi_nexthop_from_nexthop(&api.nexthops[0], &nh);
stream_putc(s, api_nh->backup_idx[i]);
}
- if (CHECK_FLAG(api_flags, ZEBRA_FLAG_SEG6LOCAL_ROUTE)) {
+ if (CHECK_FLAG(nh_flags, ZAPI_NEXTHOP_FLAG_SEG6LOCAL)) {
stream_putl(s, api_nh->seg6local_action);
stream_write(s, &api_nh->seg6local_ctx,
sizeof(struct seg6local_context));
}
- if (CHECK_FLAG(api_flags, ZEBRA_FLAG_SEG6_ROUTE))
+ if (CHECK_FLAG(nh_flags, ZAPI_NEXTHOP_FLAG_SEG6))
stream_write(s, &api_nh->seg6_segs,
sizeof(struct in6_addr));
STREAM_GETC(s, api_nh->backup_idx[i]);
}
- if (CHECK_FLAG(api_flags, ZEBRA_FLAG_SEG6LOCAL_ROUTE)) {
+ if (CHECK_FLAG(api_nh->flags, ZAPI_NEXTHOP_FLAG_SEG6LOCAL)) {
STREAM_GETL(s, api_nh->seg6local_action);
STREAM_GET(&api_nh->seg6local_ctx, s,
sizeof(struct seg6local_context));
}
- if (CHECK_FLAG(api_flags, ZEBRA_FLAG_SEG6_ROUTE))
+ if (CHECK_FLAG(api_nh->flags, ZAPI_NEXTHOP_FLAG_SEG6))
STREAM_GET(&api_nh->seg6_segs, s,
sizeof(struct in6_addr));
if (nh->nh_srv6) {
if (nh->nh_srv6->seg6local_action !=
ZEBRA_SEG6_LOCAL_ACTION_UNSPEC) {
+ SET_FLAG(znh->flags, ZAPI_NEXTHOP_FLAG_SEG6LOCAL);
znh->seg6local_action = nh->nh_srv6->seg6local_action;
memcpy(&znh->seg6local_ctx,
&nh->nh_srv6->seg6local_ctx,
sizeof(struct seg6local_context));
}
- if (!sid_zero(&nh->nh_srv6->seg6_segs))
+ if (!sid_zero(&nh->nh_srv6->seg6_segs)) {
+ SET_FLAG(znh->flags, ZAPI_NEXTHOP_FLAG_SEG6);
memcpy(&znh->seg6_segs, &nh->nh_srv6->seg6_segs,
sizeof(struct in6_addr));
+ }
}
return 0;
#define ZAPI_NEXTHOP_FLAG_LABEL 0x02
#define ZAPI_NEXTHOP_FLAG_WEIGHT 0x04
#define ZAPI_NEXTHOP_FLAG_HAS_BACKUP 0x08 /* Nexthop has a backup */
+#define ZAPI_NEXTHOP_FLAG_SEG6 0x10
+#define ZAPI_NEXTHOP_FLAG_SEG6LOCAL 0x20
/*
* ZAPI Nexthop Group. For use with protocol creation of nexthop groups.
* offload situation.
*/
#define ZEBRA_FLAG_OFFLOAD_FAILED 0x200
-/*
- * This flag tells Zebra that the route is a seg6 route and should
- * be treated specially.
- */
-#define ZEBRA_FLAG_SEG6_ROUTE 0x400
-/*
- * This flag tells Zebra that the route is a seg6local route and
- * should be treated specially.
- */
-#define ZEBRA_FLAG_SEG6LOCAL_ROUTE 0x800
/* The older XXX_MESSAGE flags live here */
uint32_t message;
sg.r.nhop.gate.ipv6 = seg6_nh6;
sg.r.nhop.vrf_id = vrf->vrf_id;
sg.r.nhop_group.nexthop = &sg.r.nhop;
-
nexthop_add_srv6_seg6(&sg.r.nhop, &seg6_seg);
- SET_FLAG(route_flags, ZEBRA_FLAG_SEG6_ROUTE);
sg.r.vrf_id = vrf->vrf_id;
sharp_install_routes_helper(&prefix, sg.r.vrf_id, sg.r.inst, 0,
sg.r.nhop.vrf_id = vrf->vrf_id;
sg.r.nhop_group.nexthop = &sg.r.nhop;
nexthop_add_srv6_seg6local(&sg.r.nhop, action, &ctx);
- SET_FLAG(route_flags, ZEBRA_FLAG_SEG6LOCAL_ROUTE);
sg.r.vrf_id = vrf->vrf_id;
sharp_install_routes_helper(&sg.r.orig_prefix, sg.r.vrf_id, sg.r.inst, 0,
&api_nh->labels[0]);
}
- if (CHECK_FLAG(flags, ZEBRA_FLAG_SEG6LOCAL_ROUTE)
+ if (CHECK_FLAG(api_nh->flags, ZAPI_NEXTHOP_FLAG_SEG6LOCAL)
&& api_nh->type != NEXTHOP_TYPE_BLACKHOLE) {
if (IS_ZEBRA_DEBUG_RECV)
zlog_debug("%s: adding seg6local action %s",
&api_nh->seg6local_ctx);
}
- if (CHECK_FLAG(flags, ZEBRA_FLAG_SEG6_ROUTE)
+ if (CHECK_FLAG(api_nh->flags, ZAPI_NEXTHOP_FLAG_SEG6)
&& api_nh->type != NEXTHOP_TYPE_BLACKHOLE) {
if (IS_ZEBRA_DEBUG_RECV)
zlog_debug("%s: adding seg6", __func__);