else
json_nlri_path = json_paths;
}
- if (display == NLRI_STRING_FORMAT_LARGE)
+ if (display == NLRI_STRING_FORMAT_LARGE && binfo)
vty_out(vty, "BGP flowspec entry: (flags 0x%x)\n",
binfo->flags);
bgp_fs_nlri_get_string((unsigned char *)
static void bgp_process_main_one(struct bgp *bgp, struct bgp_node *rn,
afi_t afi, safi_t safi)
{
- struct prefix *p = &rn->p;
struct bgp_info *new_select;
struct bgp_info *old_select;
struct bgp_info_pair old_and_new;
return;
}
+ struct prefix *p = &rn->p;
+
debug = bgp_debug_bestpath(&rn->p);
if (debug) {
prefix2str(&rn->p, pfx_buf, sizeof(pfx_buf));
else if (peer->as_type == AS_EXTERNAL)
return BGP_PEER_EBGP;
- else if (peer->as_type == AS_SPECIFIED && peer->as)
+ else if (peer->as_type == AS_SPECIFIED && peer->as) {
+ assert(bgp);
return (bgp->as == peer->as ? BGP_PEER_IBGP
: BGP_PEER_EBGP);
+ }
else {
struct peer *peer1;
h = bgp->rfapi;
- assert(!CHECK_FLAG(h->flags, RFAPI_INCALLBACK));
+ assert(h != NULL && !CHECK_FLAG(h->flags, RFAPI_INCALLBACK));
if (CHECK_FLAG(rfd->flags,
RFAPI_HD_FLAG_CLOSING_ADMINISTRATIVELY)
struct rfapi_descriptor *rfd;
vncHDBgpDirect.peer = bi->peer;
+ assert(bi->extra);
+
rfd = bi->extra->vnc.export
.rfapi_handle;
const char *protocolname;
char *cp = NULL;
+ assert(vty);
+
/*
* Log non empty command lines
*/
/* format the base vty info */
snprintf(vty_str, sizeof(vty_str), "vty[??]@%s", vty->address);
- if (vty)
- for (i = 0; i < vector_active(vtyvec); i++)
- if (vty == vector_slot(vtyvec, i)) {
- snprintf(vty_str, sizeof(vty_str),
- "vty[%d]@%s", i, vty->address);
- break;
- }
+
+ for (i = 0; i < vector_active(vtyvec); i++)
+ if (vty == vector_slot(vtyvec, i)) {
+ snprintf(vty_str, sizeof(vty_str), "vty[%d]@%s",
+ i, vty->address);
+ break;
+ }
/* format the prompt */
snprintf(prompt_str, sizeof(prompt_str), cmd_prompt(vty->node),
char yielded = 0;
wq = THREAD_ARG(thread);
- wq->thread = NULL;
assert(wq);
+ wq->thread = NULL;
+
/* calculate cycle granularity:
* list iteration == 1 run
* listnode processing == 1 cycle
zlog_debug(
"ospf_translated_nssa_refresh(): no Type-7 found for "
"Type-5 LSA Id %s",
- inet_ntoa(type5->data->id));
+ type5 ? inet_ntoa(type5->data->id) : "(null)");
return NULL;
}
zlog_debug(
"ospf_translated_nssa_refresh(): No translated Type-5 "
"found for Type-7 with Id %s",
- inet_ntoa(type7->data->id));
+ type7 ? inet_ntoa(type7->data->id) : "(null)");
return NULL;
}
zlog_debug(
"ospf_translated_nssa_refresh(): Could not translate "
"Type-7 for %s to Type-5",
- inet_ntoa(type7->data->id));
+ type7 ? inet_ntoa(type7->data->id) : "(null)");
return NULL;
}
zlog_debug(
"ospf_translated_nssa_refresh(): Could not install "
"translated LSA, Id %s",
- inet_ntoa(type7->data->id));
+ type7 ? inet_ntoa(type7->data->id) : "(null)");
return NULL;
}
vty_out(vty, " Poll interval %d\n", nbr_nbma->v_poll);
/* Show poll-interval timer. */
- if (use_json) {
- long time_store;
- time_store = monotime_until(&nbr_nbma->t_poll->u.sands, NULL)
- / 1000LL;
- json_object_int_add(json_sub, "pollIntervalTimerDueMsec",
- time_store);
- } else
- vty_out(vty, " Poll timer due in %s\n",
- ospf_timer_dump(nbr_nbma->t_poll, timebuf,
- sizeof(timebuf)));
+ if (nbr_nbma->t_poll) {
+ if (use_json) {
+ long time_store;
+ time_store = monotime_until(&nbr_nbma->t_poll->u.sands,
+ NULL) / 1000LL;
+ json_object_int_add(json_sub,
+ "pollIntervalTimerDueMsec",
+ time_store);
+ } else
+ vty_out(vty, " Poll timer due in %s\n",
+ ospf_timer_dump(nbr_nbma->t_poll, timebuf,
+ sizeof(timebuf)));
+ }
/* Show poll-interval timer thread. */
if (use_json) {
struct pim_rpf *rpg;
struct prefix_sg sg;
- rpg = RP(pim_ifp->pim, msg->im_dst);
+ rpg = pim_ifp ? RP(pim_ifp->pim, msg->im_dst) : NULL;
/*
* If the incoming interface is unknown OR
* the Interface type is SSM we don't need to
pim_ifp = up->rpf.source_nexthop.interface->info;
- rpg = RP(pim_ifp->pim, sg.grp);
+ rpg = pim_ifp ? RP(pim_ifp->pim, sg.grp) : NULL;
if ((pim_rpf_addr_is_inaddr_none(rpg)) || (!pim_ifp)
|| (!(PIM_I_am_DR(pim_ifp)))) {
}
/* Write routing table entry. */
- if (!nexthop)
+ if (!nexthop) {
+ assert(p);
stream_write(s, (uint8_t *)&p->prefix, sizeof(struct in6_addr));
- else
+ } else
stream_write(s, (uint8_t *)nexthop, sizeof(struct in6_addr));
stream_putw(s, tag);
if (p)