mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-07-09 09:47:11 +00:00
Merge pull request #7322 from Orange-OpenSource/ospf-sr
ospfd: Store neighbor Adjacency SID in SR database
This commit is contained in:
commit
2d9b665e54
@ -1046,6 +1046,7 @@ static void update_ext_link_sid(struct sr_node *srn, struct sr_link *srl,
|
|||||||
struct listnode *node;
|
struct listnode *node;
|
||||||
struct sr_link *lk;
|
struct sr_link *lk;
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
bool config = true;
|
||||||
|
|
||||||
/* Sanity check */
|
/* Sanity check */
|
||||||
if ((srn == NULL) || (srl == NULL))
|
if ((srn == NULL) || (srl == NULL))
|
||||||
@ -1053,11 +1054,11 @@ static void update_ext_link_sid(struct sr_node *srn, struct sr_link *srl,
|
|||||||
|
|
||||||
osr_debug(" |- Process Extended Link Adj/Lan-SID");
|
osr_debug(" |- Process Extended Link Adj/Lan-SID");
|
||||||
|
|
||||||
/* Skip Local Adj/Lan_Adj SID coming from neighbors */
|
/* Detect if Adj/Lan_Adj SID must be configured */
|
||||||
if (!CHECK_FLAG(lsa_flags, OSPF_LSA_SELF)
|
if (!CHECK_FLAG(lsa_flags, OSPF_LSA_SELF)
|
||||||
&& (CHECK_FLAG(srl->flags[0], EXT_SUBTLV_LINK_ADJ_SID_LFLG)
|
&& (CHECK_FLAG(srl->flags[0], EXT_SUBTLV_LINK_ADJ_SID_LFLG)
|
||||||
|| CHECK_FLAG(srl->flags[1], EXT_SUBTLV_LINK_ADJ_SID_LFLG)))
|
|| CHECK_FLAG(srl->flags[1], EXT_SUBTLV_LINK_ADJ_SID_LFLG)))
|
||||||
return;
|
config = false;
|
||||||
|
|
||||||
/* Search for existing Segment Link */
|
/* Search for existing Segment Link */
|
||||||
for (ALL_LIST_ELEMENTS_RO(srn->ext_link, node, lk))
|
for (ALL_LIST_ELEMENTS_RO(srn->ext_link, node, lk))
|
||||||
@ -1077,28 +1078,31 @@ static void update_ext_link_sid(struct sr_node *srn, struct sr_link *srl,
|
|||||||
IPV4_ADDR_COPY(&srl->adv_router, &srn->adv_router);
|
IPV4_ADDR_COPY(&srl->adv_router, &srn->adv_router);
|
||||||
listnode_add(srn->ext_link, srl);
|
listnode_add(srn->ext_link, srl);
|
||||||
/* Try to set MPLS table */
|
/* Try to set MPLS table */
|
||||||
if (compute_link_nhlfe(srl)) {
|
if (config && compute_link_nhlfe(srl)) {
|
||||||
add_adj_sid(srl->nhlfe[0]);
|
add_adj_sid(srl->nhlfe[0]);
|
||||||
add_adj_sid(srl->nhlfe[1]);
|
add_adj_sid(srl->nhlfe[1]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
/* Update SR-Link if they are different */
|
||||||
if (sr_link_cmp(lk, srl)) {
|
if (sr_link_cmp(lk, srl)) {
|
||||||
if (compute_link_nhlfe(srl)) {
|
/* Try to set MPLS table */
|
||||||
update_adj_sid(lk->nhlfe[0], srl->nhlfe[0]);
|
if (config) {
|
||||||
update_adj_sid(lk->nhlfe[1], srl->nhlfe[1]);
|
if (compute_link_nhlfe(srl)) {
|
||||||
/* Replace Segment List */
|
update_adj_sid(lk->nhlfe[0],
|
||||||
listnode_delete(srn->ext_link, lk);
|
srl->nhlfe[0]);
|
||||||
XFREE(MTYPE_OSPF_SR_PARAMS, lk);
|
update_adj_sid(lk->nhlfe[1],
|
||||||
srl->srn = srn;
|
srl->nhlfe[1]);
|
||||||
IPV4_ADDR_COPY(&srl->adv_router,
|
} else {
|
||||||
&srn->adv_router);
|
del_adj_sid(lk->nhlfe[0]);
|
||||||
listnode_add(srn->ext_link, srl);
|
del_adj_sid(lk->nhlfe[1]);
|
||||||
} else {
|
}
|
||||||
/* New NHLFE was not found.
|
|
||||||
* Just free the SR Link
|
|
||||||
*/
|
|
||||||
XFREE(MTYPE_OSPF_SR_PARAMS, srl);
|
|
||||||
}
|
}
|
||||||
|
/* Replace SR-Link in SR-Node Adjacency List */
|
||||||
|
listnode_delete(srn->ext_link, lk);
|
||||||
|
XFREE(MTYPE_OSPF_SR_PARAMS, lk);
|
||||||
|
srl->srn = srn;
|
||||||
|
IPV4_ADDR_COPY(&srl->adv_router, &srn->adv_router);
|
||||||
|
listnode_add(srn->ext_link, srl);
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
* This is just an LSA refresh.
|
* This is just an LSA refresh.
|
||||||
|
@ -269,7 +269,7 @@ struct sr_node {
|
|||||||
|
|
||||||
/* List of Prefix & Link advertise by this node */
|
/* List of Prefix & Link advertise by this node */
|
||||||
struct list *ext_prefix; /* For Node SID */
|
struct list *ext_prefix; /* For Node SID */
|
||||||
struct list *ext_link; /* For Adj and LAN SID */
|
struct list *ext_link; /* For Adjacency SID */
|
||||||
|
|
||||||
/* Pointer to FRR SR-Node or NULL if it is not a neighbor */
|
/* Pointer to FRR SR-Node or NULL if it is not a neighbor */
|
||||||
struct sr_node *neighbor;
|
struct sr_node *neighbor;
|
||||||
|
Loading…
Reference in New Issue
Block a user