summaryrefslogtreecommitdiff
path: root/tests/isisd/test_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/isisd/test_common.c')
-rw-r--r--tests/isisd/test_common.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/tests/isisd/test_common.c b/tests/isisd/test_common.c
index d0288f600d..e47456965e 100644
--- a/tests/isisd/test_common.c
+++ b/tests/isisd/test_common.c
@@ -98,7 +98,7 @@ static void lsp_add_ip_reach(struct isis_lsp *lsp,
{
struct prefix prefix;
struct sr_prefix_cfg pcfg = {};
- struct sr_prefix_cfg *pcfg_p = NULL;
+ struct sr_prefix_cfg *pcfg_p[SR_ALGORITHM_COUNT] = {NULL};
if (str2prefix(prefix_str, &prefix) != 1) {
zlog_debug("%s: invalid network: %s", __func__, prefix_str);
@@ -106,7 +106,7 @@ static void lsp_add_ip_reach(struct isis_lsp *lsp,
}
if (CHECK_FLAG(tnode->flags, F_ISIS_TEST_NODE_SR)) {
- pcfg_p = &pcfg;
+ pcfg_p[SR_ALGORITHM_SPF] = &pcfg;
pcfg.sid = *next_sid_index;
*next_sid_index = *next_sid_index + 1;
@@ -163,31 +163,32 @@ static void lsp_add_reach(struct isis_lsp *lsp,
static void lsp_add_router_capability(struct isis_lsp *lsp,
const struct isis_test_node *tnode)
{
- struct isis_router_cap cap = {};
+ struct isis_router_cap *cap;
if (!tnode->router_id)
return;
- if (inet_pton(AF_INET, tnode->router_id, &cap.router_id) != 1) {
+ cap = isis_tlvs_init_router_capability(lsp->tlvs);
+
+ if (inet_pton(AF_INET, tnode->router_id, &cap->router_id) != 1) {
zlog_debug("%s: invalid router-id: %s", __func__,
tnode->router_id);
return;
}
if (CHECK_FLAG(tnode->flags, F_ISIS_TEST_NODE_SR)) {
- cap.srgb.flags =
+ cap->srgb.flags =
ISIS_SUBTLV_SRGB_FLAG_I | ISIS_SUBTLV_SRGB_FLAG_V;
- cap.srgb.lower_bound = tnode->srgb.lower_bound
- ? tnode->srgb.lower_bound
- : SRGB_DFTL_LOWER_BOUND;
- cap.srgb.range_size = tnode->srgb.range_size
- ? tnode->srgb.range_size
- : SRGB_DFTL_RANGE_SIZE;
- cap.algo[0] = SR_ALGORITHM_SPF;
- cap.algo[1] = SR_ALGORITHM_UNSET;
+ cap->srgb.lower_bound = tnode->srgb.lower_bound
+ ? tnode->srgb.lower_bound
+ : SRGB_DFTL_LOWER_BOUND;
+ cap->srgb.range_size = tnode->srgb.range_size
+ ? tnode->srgb.range_size
+ : SRGB_DFTL_RANGE_SIZE;
+ cap->algo[0] = SR_ALGORITHM_SPF;
+ cap->algo[1] = SR_ALGORITHM_UNSET;
}
- isis_tlvs_set_router_capability(lsp->tlvs, &cap);
}
static void lsp_add_mt_router_info(struct isis_lsp *lsp,