diff options
| author | Igor Ryzhov <iryzhov@nfware.com> | 2021-06-23 00:23:18 +0300 |
|---|---|---|
| committer | Igor Ryzhov <iryzhov@nfware.com> | 2021-06-23 15:52:37 +0300 |
| commit | 80ab95b134b00a115175adc46b82a3f69f58ec87 (patch) | |
| tree | 5c8ee65603cd41cf12c218da276bd3fc05f6bafd | |
| parent | 0a156eecf2d4db42e3f21b35fbc09e2516898c53 (diff) | |
isisd: fix instance ldp-sync configuration
Don't rely on operational data to validate that configuration is applied
to the default VRF. The VRF name is stored in the config - use it instead.
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
| -rw-r--r-- | isisd/isis_nb_config.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/isisd/isis_nb_config.c b/isisd/isis_nb_config.c index 515ceadea4..a0da19fce8 100644 --- a/isisd/isis_nb_config.c +++ b/isisd/isis_nb_config.c @@ -2383,14 +2383,14 @@ int isis_instance_segment_routing_prefix_sid_map_prefix_sid_n_flag_clear_modify( int isis_instance_mpls_ldp_sync_create(struct nb_cb_create_args *args) { struct isis_area *area; + const char *vrfname; switch (args->event) { case NB_EV_VALIDATE: - area = nb_running_get_entry(args->dnode, NULL, false); - if (area == NULL || area->isis == NULL) - return NB_ERR_VALIDATION; + vrfname = yang_dnode_get_string( + lyd_parent(lyd_parent(args->dnode)), "./vrf"); - if (area->isis->vrf_id != VRF_DEFAULT) { + if (strcmp(vrfname, VRF_DEFAULT_NAME)) { snprintf(args->errmsg, args->errmsg_len, "LDP-Sync only runs on Default VRF"); return NB_ERR_VALIDATION; @@ -2427,14 +2427,15 @@ int isis_instance_mpls_ldp_sync_holddown_modify(struct nb_cb_modify_args *args) { struct isis_area *area; uint16_t holddown; + const char *vrfname; switch (args->event) { case NB_EV_VALIDATE: - area = nb_running_get_entry(args->dnode, NULL, false); - if (area == NULL || area->isis == NULL) - return NB_ERR_VALIDATION; + vrfname = yang_dnode_get_string( + lyd_parent(lyd_parent(lyd_parent(args->dnode))), + "./vrf"); - if (area->isis->vrf_id != VRF_DEFAULT) { + if (strcmp(vrfname, VRF_DEFAULT_NAME)) { snprintf(args->errmsg, args->errmsg_len, "LDP-Sync only runs on Default VRF"); return NB_ERR_VALIDATION; |
