summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bgpd/bgp_route.c8
-rw-r--r--bgpd/rfapi/rfapi_rib.c10
-rw-r--r--eigrpd/eigrp_vty.c5
3 files changed, 21 insertions, 2 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 38ad7a6e0..7cdc83961 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -8617,8 +8617,14 @@ static int bgp_show_route(struct vty *vty, struct bgp *bgp, const char *ip_str,
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)
diff --git a/bgpd/rfapi/rfapi_rib.c b/bgpd/rfapi/rfapi_rib.c
index a414df1ab..791eb4c91 100644
--- a/bgpd/rfapi/rfapi_rib.c
+++ b/bgpd/rfapi/rfapi_rib.c
@@ -2236,9 +2236,12 @@ void rfapiRibShowResponsesSummary(void *stream)
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);
@@ -2388,6 +2391,11 @@ void rfapiRibShowResponses(void *stream, struct prefix *pfx_match,
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
*/
diff --git a/eigrpd/eigrp_vty.c b/eigrpd/eigrp_vty.c
index d416183f5..746db2abe 100644
--- a/eigrpd/eigrp_vty.c
+++ b/eigrpd/eigrp_vty.c
@@ -237,6 +237,11 @@ DEFUN (no_router_eigrp,
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;