diff options
Diffstat (limited to 'isisd/isis_cli.c')
| -rw-r--r-- | isisd/isis_cli.c | 51 |
1 files changed, 30 insertions, 21 deletions
diff --git a/isisd/isis_cli.c b/isisd/isis_cli.c index 383f23758a..6c6d88ad53 100644 --- a/isisd/isis_cli.c +++ b/isisd/isis_cli.c @@ -170,15 +170,19 @@ DEFPY_YANG(ip_router_isis, ip_router_isis_cmd, return CMD_SUCCESS; } ifp = nb_running_get_entry(NULL, VTY_CURR_XPATH, false); - - if (!vrf_name && ifp->vrf_id == VRF_DEFAULT) - vrf_name = VRF_DEFAULT_NAME; - - if (ifp->vrf_id != VRF_DEFAULT) { - vrf = vrf_lookup_by_id(ifp->vrf_id); - if (vrf && !vrf_name) - vrf_name = vrf->name; + if (!vrf_name) { + if (ifp) { + if (ifp->vrf_id == VRF_DEFAULT) + vrf_name = VRF_DEFAULT_NAME; + else { + vrf = vrf_lookup_by_id(ifp->vrf_id); + if (vrf && !vrf_name) + vrf_name = vrf->name; + } + } else + vrf_name = VRF_DEFAULT_NAME; } + area = isis_area_lookup_by_vrf(tag, vrf_name); if (!area) { isis_global_instance_create(vrf_name); @@ -235,7 +239,7 @@ DEFPY_YANG(ip_router_isis, ip_router_isis_cmd, } /* check if the interface is a loopback and if so set it as passive */ - if (if_is_loopback(ifp)) + if (ifp && if_is_loopback(ifp)) nb_cli_enqueue_change(vty, "./frr-isisd:isis/passive", NB_OP_MODIFY, "true"); @@ -263,14 +267,19 @@ DEFPY_YANG(ip6_router_isis, ip6_router_isis_cmd, return CMD_SUCCESS; ifp = nb_running_get_entry(NULL, VTY_CURR_XPATH, false); - if (!vrf_name && ifp->vrf_id == VRF_DEFAULT) - vrf_name = VRF_DEFAULT_NAME; - - if (ifp->vrf_id != VRF_DEFAULT) { - vrf = vrf_lookup_by_id(ifp->vrf_id); - if (vrf && !vrf_name) - vrf_name = vrf->name; + if (!vrf_name) { + if (ifp) { + if (ifp->vrf_id == VRF_DEFAULT) + vrf_name = VRF_DEFAULT_NAME; + else { + vrf = vrf_lookup_by_id(ifp->vrf_id); + if (vrf && !vrf_name) + vrf_name = vrf->name; + } + } else + vrf_name = VRF_DEFAULT_NAME; } + area = isis_area_lookup_by_vrf(tag, vrf_name); if (!area) { isis_global_instance_create(vrf_name); @@ -326,7 +335,7 @@ DEFPY_YANG(ip6_router_isis, ip6_router_isis_cmd, } /* check if the interface is a loopback and if so set it as passive */ - if (if_is_loopback(ifp)) + if (ifp && if_is_loopback(ifp)) nb_cli_enqueue_change(vty, "./frr-isisd:isis/passive", NB_OP_MODIFY, "true"); @@ -1633,9 +1642,9 @@ DEFPY_YANG (isis_sr_prefix_sid, "Prefix SID\n" "IPv4 Prefix\n" "IPv6 Prefix\n" - "Specify the absolute value of Prefix Segement ID\n" + "Specify the absolute value of Prefix Segment ID\n" "The Prefix Segment ID value\n" - "Specify the index of Prefix Segement ID\n" + "Specify the index of Prefix Segment ID\n" "The Prefix Segment ID index\n" "Don't request Penultimate Hop Popping (PHP)\n" "Upstream neighbor must replace prefix-sid with explicit null label\n" @@ -1675,9 +1684,9 @@ DEFPY_YANG (no_isis_sr_prefix_sid, "Prefix SID\n" "IPv4 Prefix\n" "IPv6 Prefix\n" - "Specify the absolute value of Prefix Segement ID\n" + "Specify the absolute value of Prefix Segment ID\n" "The Prefix Segment ID value\n" - "Specify the index of Prefix Segement ID\n" + "Specify the index of Prefix Segment ID\n" "The Prefix Segment ID index\n" "Don't request Penultimate Hop Popping (PHP)\n" "Upstream neighbor must replace prefix-sid with explicit null label\n" |
