Skip to content

Commit

Permalink
ospfd: fix internal ldp-sync state flags when feature is disabled
Browse files Browse the repository at this point in the history
When enabling "mpls ldp-sync" under "router ospf" ospfd configures
SET_FLAG(ldp_sync_info->flags, LDP_SYNC_FLAG_IF_CONFIG) so internally knowing
that the ldp-sync feature is enabled. However the flag is not cleared when
turning of the feature using "nompls ldp-sync"!

FRRouting#16375

Signed-off-by: Christian Breunig <[email protected]>
(cherry picked from commit 5a70378)
  • Loading branch information
c-po authored and mergify[bot] committed Jul 23, 2024
1 parent 9a64394 commit 7cb4488
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion ospfd/ospf_ldp_sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ DEFPY (no_mpls_ldp_sync,
* stop holddown timer if running
* restore ospf cost
*/
SET_FLAG(ldp_sync_info->flags, LDP_SYNC_FLAG_IF_CONFIG);
UNSET_FLAG(ldp_sync_info->flags, LDP_SYNC_FLAG_IF_CONFIG);
ldp_sync_info->enabled = LDP_IGP_SYNC_DEFAULT;
ldp_sync_info->state = LDP_IGP_SYNC_STATE_NOT_REQUIRED;
EVENT_OFF(ldp_sync_info->t_holddown);
Expand Down
4 changes: 2 additions & 2 deletions tests/topotests/ldp_sync_ospf_topo1/r2/show_ospf_ldp_sync.ref
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"ldpIgpSyncState":"Sync achieved"
},
"r2-eth2":{
"ldpIgpSyncEnabled":false,
"ldpIgpSyncEnabled":true,
"holdDownTimeInSec":50,
"ldpIgpSyncState":"Sync not required"
"ldpIgpSyncState":"Sync achieved"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"ldpIgpSyncState":"Holding down until Sync"
},
"r2-eth2":{
"ldpIgpSyncEnabled":false,
"ldpIgpSyncEnabled":true,
"holdDownTimeInSec":50,
"ldpIgpSyncState":"Sync not required"
"ldpIgpSyncState":"Sync achieved"
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"r2-eth2":{
"ldpIgpSyncEnabled":false,
"ldpIgpSyncEnabled":true,
"holdDownTimeInSec":50,
"ldpIgpSyncState":"Sync not required"
"ldpIgpSyncState":"Sync achieved"
}
}
4 changes: 2 additions & 2 deletions tests/topotests/ldp_sync_ospf_topo1/r3/show_ospf_ldp_sync.ref
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"r3-eth1":{
"ldpIgpSyncEnabled":false,
"ldpIgpSyncEnabled":true,
"holdDownTimeInSec":50,
"ldpIgpSyncState":"Sync not required"
"ldpIgpSyncState":"Sync achieved"
},
"r3-eth2":{
"ldpIgpSyncEnabled":true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"r3-eth1":{
"ldpIgpSyncEnabled":false,
"ldpIgpSyncEnabled":true,
"holdDownTimeInSec":50,
"ldpIgpSyncState":"Sync not required"
"ldpIgpSyncState":"Sync achieved"
},
"r3-eth2":{
"ldpIgpSyncEnabled":true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"r3-eth1":{
"ldpIgpSyncEnabled":false,
"ldpIgpSyncEnabled":true,
"holdDownTimeInSec":50,
"ldpIgpSyncState":"Sync not required"
"ldpIgpSyncState":"Sync achieved"
},
"r3-eth2":{
"ldpIgpSyncEnabled":true,
Expand Down

0 comments on commit 7cb4488

Please sign in to comment.