mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-08 07:03:07 +00:00
Merge pull request #16835 from cscarpitta/add-sid-structure-to-seg6local-nh
bgpd, lib: Include SID structure in seg6local nexthop
This commit is contained in:
commit
81db47a175
@ -385,6 +385,18 @@ void vpn_leak_zebra_vrf_sid_update_per_af(struct bgp *bgp, afi_t afi)
|
|||||||
if (!vrf)
|
if (!vrf)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (bgp->vpn_policy[afi].tovpn_sid_locator) {
|
||||||
|
ctx.block_len =
|
||||||
|
bgp->vpn_policy[afi].tovpn_sid_locator->block_bits_length;
|
||||||
|
ctx.node_len =
|
||||||
|
bgp->vpn_policy[afi].tovpn_sid_locator->node_bits_length;
|
||||||
|
ctx.function_len =
|
||||||
|
bgp->vpn_policy[afi]
|
||||||
|
.tovpn_sid_locator->function_bits_length;
|
||||||
|
ctx.argument_len =
|
||||||
|
bgp->vpn_policy[afi]
|
||||||
|
.tovpn_sid_locator->argument_bits_length;
|
||||||
|
}
|
||||||
ctx.table = vrf->data.l.table_id;
|
ctx.table = vrf->data.l.table_id;
|
||||||
act = afi == AFI_IP ? ZEBRA_SEG6_LOCAL_ACTION_END_DT4
|
act = afi == AFI_IP ? ZEBRA_SEG6_LOCAL_ACTION_END_DT4
|
||||||
: ZEBRA_SEG6_LOCAL_ACTION_END_DT6;
|
: ZEBRA_SEG6_LOCAL_ACTION_END_DT6;
|
||||||
@ -436,6 +448,12 @@ void vpn_leak_zebra_vrf_sid_update_per_vrf(struct bgp *bgp)
|
|||||||
if (!vrf)
|
if (!vrf)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (bgp->tovpn_sid_locator) {
|
||||||
|
ctx.block_len = bgp->tovpn_sid_locator->block_bits_length;
|
||||||
|
ctx.node_len = bgp->tovpn_sid_locator->node_bits_length;
|
||||||
|
ctx.function_len = bgp->tovpn_sid_locator->function_bits_length;
|
||||||
|
ctx.argument_len = bgp->tovpn_sid_locator->argument_bits_length;
|
||||||
|
}
|
||||||
ctx.table = vrf->data.l.table_id;
|
ctx.table = vrf->data.l.table_id;
|
||||||
act = ZEBRA_SEG6_LOCAL_ACTION_END_DT46;
|
act = ZEBRA_SEG6_LOCAL_ACTION_END_DT46;
|
||||||
zclient_send_localsid(zclient, tovpn_sid, bgp->vrf_id, act, &ctx);
|
zclient_send_localsid(zclient, tovpn_sid, bgp->vrf_id, act, &ctx);
|
||||||
@ -475,6 +493,7 @@ void vpn_leak_zebra_vrf_sid_withdraw_per_af(struct bgp *bgp, afi_t afi)
|
|||||||
{
|
{
|
||||||
int debug = BGP_DEBUG(vpn, VPN_LEAK_LABEL);
|
int debug = BGP_DEBUG(vpn, VPN_LEAK_LABEL);
|
||||||
struct srv6_sid_ctx ctx = {};
|
struct srv6_sid_ctx ctx = {};
|
||||||
|
struct seg6local_context seg6localctx = {};
|
||||||
|
|
||||||
if (bgp->vrf_id == VRF_UNKNOWN) {
|
if (bgp->vrf_id == VRF_UNKNOWN) {
|
||||||
if (debug)
|
if (debug)
|
||||||
@ -487,9 +506,22 @@ void vpn_leak_zebra_vrf_sid_withdraw_per_af(struct bgp *bgp, afi_t afi)
|
|||||||
zlog_debug("%s: deleting sid for vrf %s afi (id=%d)", __func__,
|
zlog_debug("%s: deleting sid for vrf %s afi (id=%d)", __func__,
|
||||||
bgp->name_pretty, bgp->vrf_id);
|
bgp->name_pretty, bgp->vrf_id);
|
||||||
|
|
||||||
|
if (bgp->vpn_policy[afi].tovpn_sid_locator) {
|
||||||
|
seg6localctx.block_len =
|
||||||
|
bgp->vpn_policy[afi].tovpn_sid_locator->block_bits_length;
|
||||||
|
seg6localctx.node_len =
|
||||||
|
bgp->vpn_policy[afi].tovpn_sid_locator->node_bits_length;
|
||||||
|
seg6localctx.function_len =
|
||||||
|
bgp->vpn_policy[afi]
|
||||||
|
.tovpn_sid_locator->function_bits_length;
|
||||||
|
seg6localctx.argument_len =
|
||||||
|
bgp->vpn_policy[afi]
|
||||||
|
.tovpn_sid_locator->argument_bits_length;
|
||||||
|
}
|
||||||
zclient_send_localsid(zclient,
|
zclient_send_localsid(zclient,
|
||||||
bgp->vpn_policy[afi].tovpn_zebra_vrf_sid_last_sent,
|
bgp->vpn_policy[afi].tovpn_zebra_vrf_sid_last_sent,
|
||||||
bgp->vrf_id, ZEBRA_SEG6_LOCAL_ACTION_UNSPEC, NULL);
|
bgp->vrf_id, ZEBRA_SEG6_LOCAL_ACTION_UNSPEC,
|
||||||
|
&seg6localctx);
|
||||||
XFREE(MTYPE_BGP_SRV6_SID,
|
XFREE(MTYPE_BGP_SRV6_SID,
|
||||||
bgp->vpn_policy[afi].tovpn_zebra_vrf_sid_last_sent);
|
bgp->vpn_policy[afi].tovpn_zebra_vrf_sid_last_sent);
|
||||||
bgp->vpn_policy[afi].tovpn_zebra_vrf_sid_last_sent = NULL;
|
bgp->vpn_policy[afi].tovpn_zebra_vrf_sid_last_sent = NULL;
|
||||||
@ -508,6 +540,7 @@ void vpn_leak_zebra_vrf_sid_withdraw_per_vrf(struct bgp *bgp)
|
|||||||
{
|
{
|
||||||
int debug = BGP_DEBUG(vpn, VPN_LEAK_LABEL);
|
int debug = BGP_DEBUG(vpn, VPN_LEAK_LABEL);
|
||||||
struct srv6_sid_ctx ctx = {};
|
struct srv6_sid_ctx ctx = {};
|
||||||
|
struct seg6local_context seg6localctx = {};
|
||||||
|
|
||||||
if (bgp->vrf_id == VRF_UNKNOWN) {
|
if (bgp->vrf_id == VRF_UNKNOWN) {
|
||||||
if (debug)
|
if (debug)
|
||||||
@ -521,9 +554,18 @@ void vpn_leak_zebra_vrf_sid_withdraw_per_vrf(struct bgp *bgp)
|
|||||||
zlog_debug("%s: deleting sid for vrf %s (id=%d)", __func__,
|
zlog_debug("%s: deleting sid for vrf %s (id=%d)", __func__,
|
||||||
bgp->name_pretty, bgp->vrf_id);
|
bgp->name_pretty, bgp->vrf_id);
|
||||||
|
|
||||||
|
if (bgp->tovpn_sid_locator) {
|
||||||
|
seg6localctx.block_len =
|
||||||
|
bgp->tovpn_sid_locator->block_bits_length;
|
||||||
|
seg6localctx.node_len = bgp->tovpn_sid_locator->node_bits_length;
|
||||||
|
seg6localctx.function_len =
|
||||||
|
bgp->tovpn_sid_locator->function_bits_length;
|
||||||
|
seg6localctx.argument_len =
|
||||||
|
bgp->tovpn_sid_locator->argument_bits_length;
|
||||||
|
}
|
||||||
zclient_send_localsid(zclient, bgp->tovpn_zebra_vrf_sid_last_sent,
|
zclient_send_localsid(zclient, bgp->tovpn_zebra_vrf_sid_last_sent,
|
||||||
bgp->vrf_id, ZEBRA_SEG6_LOCAL_ACTION_UNSPEC,
|
bgp->vrf_id, ZEBRA_SEG6_LOCAL_ACTION_UNSPEC,
|
||||||
NULL);
|
&seg6localctx);
|
||||||
XFREE(MTYPE_BGP_SRV6_SID, bgp->tovpn_zebra_vrf_sid_last_sent);
|
XFREE(MTYPE_BGP_SRV6_SID, bgp->tovpn_zebra_vrf_sid_last_sent);
|
||||||
bgp->tovpn_zebra_vrf_sid_last_sent = NULL;
|
bgp->tovpn_zebra_vrf_sid_last_sent = NULL;
|
||||||
|
|
||||||
|
@ -106,6 +106,10 @@ struct seg6local_context {
|
|||||||
struct in6_addr nh6;
|
struct in6_addr nh6;
|
||||||
uint32_t table;
|
uint32_t table;
|
||||||
struct seg6local_flavors_info flv;
|
struct seg6local_flavors_info flv;
|
||||||
|
uint8_t block_len;
|
||||||
|
uint8_t node_len;
|
||||||
|
uint8_t function_len;
|
||||||
|
uint8_t argument_len;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct srv6_locator {
|
struct srv6_locator {
|
||||||
|
Loading…
Reference in New Issue
Block a user