int prefix_check, enum bgp_path_type pathtype,
u_char use_json)
{
- if (!bgp)
+ if (!bgp) {
bgp = bgp_get_default();
+ if (!bgp) {
+ if (!use_json)
+ vty_out(vty, "No BGP process is configured\n");
+ return CMD_WARNING;
+ }
+ }
/* labeled-unicast routes live in the unicast table */
if (safi == SAFI_LABELED_UNICAST)
struct rfapi_descriptor *rfd;
struct listnode *node;
-
if (rfapiStream2Vty(stream, &fp, &vty, &out, &vty_newline) == 0)
return;
+ if (!bgp) {
+ fp(out, "Unable to find default BGP instance\n");
+ return;
+ }
fp(out, "%-24s ", "Responses: (Prefixes)");
fp(out, "%-8s %-8u ", "Active:", bgp->rfapi->rib_prefix_count_total);
if (rfapiStream2Vty(stream, &fp, &vty, &out, &vty_newline) == 0)
return;
+ if (!bgp) {
+ fp(out, "Unable to find default BGP instance\n");
+ return;
+ }
+
/*
* loop over NVEs
*/
struct eigrp *eigrp;
eigrp = eigrp_lookup();
+ if (eigrp == NULL) {
+ vty_out(vty, " EIGRP Routing Process not enabled\n");
+ return CMD_SUCCESS;
+ }
+
if (eigrp->AS != atoi(argv[3]->arg)) {
vty_out(vty, "%% Attempting to deconfigure non-existent AS\n");
return CMD_WARNING_CONFIG_FAILED;