Skip to content

Commit

Permalink
Merge pull request #14111 from opensourcerouting/isisd-tilfa-topotest…
Browse files Browse the repository at this point in the history
…-fixes

tests: improve stability of the IS-IS TI-LFA topotest
  • Loading branch information
donaldsharp authored Jul 29, 2023
2 parents f3a4a85 + 2dd4cad commit aba77de
Show file tree
Hide file tree
Showing 16 changed files with 60 additions and 53 deletions.
15 changes: 4 additions & 11 deletions isisd/isis_sr.c
Original file line number Diff line number Diff line change
Expand Up @@ -923,13 +923,14 @@ static int sr_adj_ip_disabled(struct isis_adjacency *adj, int family,
}

/**
* Activate local Prefix-SID when loopback interface goes up for IS-IS.
* Update the Node-SID flag of the configured Prefix-SID mappings in response
* to an address addition or removal event.
*
* @param ifp Loopback Interface
* @param ifp Interface
*
* @return 0
*/
static int sr_if_new_hook(struct interface *ifp)
int sr_if_addr_update(struct interface *ifp)
{
struct sr_prefix_cfg *pcfgs[SR_ALGORITHM_COUNT] = {NULL};
struct isis_circuit *circuit;
Expand All @@ -947,13 +948,7 @@ static int sr_if_new_hook(struct interface *ifp)
if (!area)
return 0;

/*
* Update the Node-SID flag of the configured Prefix-SID mappings if
* necessary. This needs to be done here since isisd reads the startup
* configuration before receiving interface information from zebra.
*/
FOR_ALL_INTERFACES_ADDRESSES (ifp, connected, node) {

for (int i = 0; i < SR_ALGORITHM_COUNT; i++) {
pcfgs[i] = isis_sr_cfg_prefix_find(
area, connected->address, i);
Expand Down Expand Up @@ -1313,7 +1308,6 @@ void isis_sr_init(void)
hook_register(isis_adj_state_change_hook, sr_adj_state_change);
hook_register(isis_adj_ip_enabled_hook, sr_adj_ip_enabled);
hook_register(isis_adj_ip_disabled_hook, sr_adj_ip_disabled);
hook_register(isis_if_new_hook, sr_if_new_hook);
}

/**
Expand All @@ -1325,5 +1319,4 @@ void isis_sr_term(void)
hook_unregister(isis_adj_state_change_hook, sr_adj_state_change);
hook_unregister(isis_adj_ip_enabled_hook, sr_adj_ip_enabled);
hook_unregister(isis_adj_ip_disabled_hook, sr_adj_ip_disabled);
hook_unregister(isis_if_new_hook, sr_if_new_hook);
}
1 change: 1 addition & 0 deletions isisd/isis_sr.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ extern struct sr_adjacency *isis_sr_adj_sid_find(struct isis_adjacency *adj,
int family,
enum sr_adj_type type);
extern void isis_area_delete_backup_adj_sids(struct isis_area *area, int level);
extern int sr_if_addr_update(struct interface *ifp);
extern char *sr_op2str(char *buf, size_t size, mpls_label_t label_in,
mpls_label_t label_out);
extern int isis_sr_start(struct isis_area *area);
Expand Down
4 changes: 4 additions & 0 deletions isisd/isis_zebra.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ static int isis_zebra_if_address_add(ZAPI_CALLBACK_ARGS)
isis_circuit_add_addr(circuit, c);
}

sr_if_addr_update(c->ifp);

return 0;
}

Expand Down Expand Up @@ -125,6 +127,8 @@ static int isis_zebra_if_address_del(ZAPI_CALLBACK_ARGS)
isis_circuit_del_addr(circuit, c);
}

sr_if_addr_update(c->ifp);

connected_free(&c);

return 0;
Expand Down
2 changes: 1 addition & 1 deletion tests/topotests/isis_tilfa_topo1/rt1/isisd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ interface eth-sw1
ip router isis 1
ipv6 router isis 1
isis hello-interval 1
isis hello-multiplier 3
isis hello-multiplier 10
isis priority 100
isis fast-reroute ti-lfa
!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
{
"neighbor-sys-type": "level-1",
"neighbor-sysid": "0000.0000.0003",
"hold-timer": 3,
"hold-timer": 10,
"neighbor-priority": 64,
"state": "up"
},
{
"neighbor-sys-type": "level-1",
"neighbor-sysid": "0000.0000.0002",
"hold-timer": 3,
"hold-timer": 10,
"neighbor-priority": 64,
"state": "up"
}
Expand Down
6 changes: 3 additions & 3 deletions tests/topotests/isis_tilfa_topo1/rt2/isisd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,23 @@ interface eth-sw1
ip router isis 1
ipv6 router isis 1
isis hello-interval 1
isis hello-multiplier 3
isis hello-multiplier 10
isis fast-reroute ti-lfa
!
interface eth-rt4-1
ip router isis 1
ipv6 router isis 1
isis network point-to-point
isis hello-interval 1
isis hello-multiplier 3
isis hello-multiplier 10
isis fast-reroute ti-lfa
!
interface eth-rt4-2
ip router isis 1
ipv6 router isis 1
isis network point-to-point
isis hello-interval 1
isis hello-multiplier 3
isis hello-multiplier 10
isis fast-reroute ti-lfa
!
router isis 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{
"neighbor-sys-type": "level-1",
"neighbor-sysid": "0000.0000.0004",
"hold-timer": 3,
"hold-timer": 10,
"neighbor-priority": 0,
"state": "up"
}
Expand All @@ -30,7 +30,7 @@
{
"neighbor-sys-type": "level-1",
"neighbor-sysid": "0000.0000.0004",
"hold-timer": 3,
"hold-timer": 10,
"neighbor-priority": 0,
"state": "up"
}
Expand All @@ -49,14 +49,14 @@
{
"neighbor-sys-type": "level-1",
"neighbor-sysid": "0000.0000.0001",
"hold-timer": 3,
"hold-timer": 10,
"neighbor-priority": 100,
"state": "up"
},
{
"neighbor-sys-type": "level-1",
"neighbor-sysid": "0000.0000.0003",
"hold-timer": 3,
"hold-timer": 10,
"neighbor-priority": 64,
"state": "up"
}
Expand Down
6 changes: 3 additions & 3 deletions tests/topotests/isis_tilfa_topo1/rt3/isisd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,23 @@ interface eth-sw1
ip router isis 1
ipv6 router isis 1
isis hello-interval 1
isis hello-multiplier 3
isis hello-multiplier 10
isis fast-reroute ti-lfa
!
interface eth-rt5-1
ip router isis 1
ipv6 router isis 1
isis network point-to-point
isis hello-interval 1
isis hello-multiplier 3
isis hello-multiplier 10
isis fast-reroute ti-lfa
!
interface eth-rt5-2
ip router isis 1
ipv6 router isis 1
isis network point-to-point
isis hello-interval 1
isis hello-multiplier 3
isis hello-multiplier 10
isis fast-reroute ti-lfa
!
router isis 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{
"neighbor-sys-type": "level-1",
"neighbor-sysid": "0000.0000.0005",
"hold-timer": 3,
"hold-timer": 10,
"neighbor-priority": 0,
"state": "up"
}
Expand All @@ -30,7 +30,7 @@
{
"neighbor-sys-type": "level-1",
"neighbor-sysid": "0000.0000.0005",
"hold-timer": 3,
"hold-timer": 10,
"neighbor-priority": 0,
"state": "up"
}
Expand All @@ -49,14 +49,14 @@
{
"neighbor-sys-type": "level-1",
"neighbor-sysid": "0000.0000.0001",
"hold-timer": 3,
"hold-timer": 10,
"neighbor-priority": 100,
"state": "up"
},
{
"neighbor-sys-type": "level-1",
"neighbor-sysid": "0000.0000.0002",
"hold-timer": 3,
"hold-timer": 10,
"neighbor-priority": 64,
"state": "up"
}
Expand Down
8 changes: 4 additions & 4 deletions tests/topotests/isis_tilfa_topo1/rt4/isisd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,31 @@ interface eth-rt2-1
ipv6 router isis 1
isis network point-to-point
isis hello-interval 1
isis hello-multiplier 3
isis hello-multiplier 10
isis fast-reroute ti-lfa
!
interface eth-rt2-2
ip router isis 1
ipv6 router isis 1
isis network point-to-point
isis hello-interval 1
isis hello-multiplier 3
isis hello-multiplier 10
isis fast-reroute ti-lfa
!
interface eth-rt5
ip router isis 1
ipv6 router isis 1
isis network point-to-point
isis hello-interval 1
isis hello-multiplier 3
isis hello-multiplier 10
isis fast-reroute ti-lfa
!
interface eth-rt6
ip router isis 1
ipv6 router isis 1
isis network point-to-point
isis hello-interval 1
isis hello-multiplier 3
isis hello-multiplier 10
isis fast-reroute ti-lfa
!
router isis 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{
"neighbor-sys-type": "level-1",
"neighbor-sysid": "0000.0000.0002",
"hold-timer": 3,
"hold-timer": 10,
"neighbor-priority": 0,
"state": "up"
}
Expand All @@ -30,7 +30,7 @@
{
"neighbor-sys-type": "level-1",
"neighbor-sysid": "0000.0000.0002",
"hold-timer": 3,
"hold-timer": 10,
"neighbor-priority": 0,
"state": "up"
}
Expand All @@ -49,7 +49,7 @@
{
"neighbor-sys-type": "level-1",
"neighbor-sysid": "0000.0000.0005",
"hold-timer": 3,
"hold-timer": 10,
"neighbor-priority": 0,
"state": "up"
}
Expand All @@ -68,7 +68,7 @@
{
"neighbor-sys-type": "level-1",
"neighbor-sysid": "0000.0000.0006",
"hold-timer": 3,
"hold-timer": 10,
"neighbor-priority": 0,
"state": "up"
}
Expand Down
8 changes: 4 additions & 4 deletions tests/topotests/isis_tilfa_topo1/rt5/isisd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,31 @@ interface eth-rt3-1
ipv6 router isis 1
isis network point-to-point
isis hello-interval 1
isis hello-multiplier 3
isis hello-multiplier 10
isis fast-reroute ti-lfa
!
interface eth-rt3-2
ip router isis 1
ipv6 router isis 1
isis network point-to-point
isis hello-interval 1
isis hello-multiplier 3
isis hello-multiplier 10
isis fast-reroute ti-lfa
!
interface eth-rt4
ip router isis 1
ipv6 router isis 1
isis network point-to-point
isis hello-interval 1
isis hello-multiplier 3
isis hello-multiplier 10
isis fast-reroute ti-lfa
!
interface eth-rt6
ip router isis 1
ipv6 router isis 1
isis network point-to-point
isis hello-interval 1
isis hello-multiplier 3
isis hello-multiplier 10
isis fast-reroute ti-lfa
!
router isis 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{
"neighbor-sys-type": "level-1",
"neighbor-sysid": "0000.0000.0003",
"hold-timer": 3,
"hold-timer": 10,
"neighbor-priority": 0,
"state": "up"
}
Expand All @@ -30,7 +30,7 @@
{
"neighbor-sys-type": "level-1",
"neighbor-sysid": "0000.0000.0003",
"hold-timer": 3,
"hold-timer": 10,
"neighbor-priority": 0,
"state": "up"
}
Expand All @@ -49,7 +49,7 @@
{
"neighbor-sys-type": "level-1",
"neighbor-sysid": "0000.0000.0004",
"hold-timer": 3,
"hold-timer": 10,
"neighbor-priority": 0,
"state": "up"
}
Expand All @@ -68,7 +68,7 @@
{
"neighbor-sys-type": "level-1",
"neighbor-sysid": "0000.0000.0006",
"hold-timer": 3,
"hold-timer": 10,
"neighbor-priority": 0,
"state": "up"
}
Expand Down
4 changes: 2 additions & 2 deletions tests/topotests/isis_tilfa_topo1/rt6/isisd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ interface eth-rt4
ipv6 router isis 1
isis network point-to-point
isis hello-interval 1
isis hello-multiplier 3
isis hello-multiplier 10
isis fast-reroute ti-lfa
!
interface eth-rt5
ip router isis 1
ipv6 router isis 1
isis network point-to-point
isis hello-interval 1
isis hello-multiplier 3
isis hello-multiplier 10
isis fast-reroute ti-lfa
!
router isis 1
Expand Down
Loading

0 comments on commit aba77de

Please sign in to comment.