mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-30 22:25:41 +00:00
Merge pull request #2513 from pacovn/Coverity_1455334_et_al_Dereference_null_return_value
eigrpd: null check (Coverity 1455334 and 4 alike)
This commit is contained in:
commit
132880ad0a
@ -486,6 +486,7 @@ int eigrp_fsm_event_q_fcn(struct eigrp_fsm_action_message *msg)
|
|||||||
|
|
||||||
int eigrp_fsm_event_keep_state(struct eigrp_fsm_action_message *msg)
|
int eigrp_fsm_event_keep_state(struct eigrp_fsm_action_message *msg)
|
||||||
{
|
{
|
||||||
|
struct eigrp *eigrp;
|
||||||
struct eigrp_prefix_entry *prefix = msg->prefix;
|
struct eigrp_prefix_entry *prefix = msg->prefix;
|
||||||
struct eigrp_nexthop_entry *ne = listnode_head(prefix->entries);
|
struct eigrp_nexthop_entry *ne = listnode_head(prefix->entries);
|
||||||
|
|
||||||
@ -498,8 +499,9 @@ int eigrp_fsm_event_keep_state(struct eigrp_fsm_action_message *msg)
|
|||||||
if (msg->packet_type == EIGRP_OPC_QUERY)
|
if (msg->packet_type == EIGRP_OPC_QUERY)
|
||||||
eigrp_send_reply(msg->adv_router, prefix);
|
eigrp_send_reply(msg->adv_router, prefix);
|
||||||
prefix->req_action |= EIGRP_FSM_NEED_UPDATE;
|
prefix->req_action |= EIGRP_FSM_NEED_UPDATE;
|
||||||
listnode_add(
|
eigrp = eigrp_lookup();
|
||||||
(eigrp_lookup())->topology_changes_internalIPV4,
|
assert(eigrp);
|
||||||
|
listnode_add(eigrp->topology_changes_internalIPV4,
|
||||||
prefix);
|
prefix);
|
||||||
}
|
}
|
||||||
eigrp_topology_update_node_flags(prefix);
|
eigrp_topology_update_node_flags(prefix);
|
||||||
|
@ -336,6 +336,9 @@ void eigrp_if_free(struct eigrp_interface *ei, int source)
|
|||||||
struct eigrp_prefix_entry *pe;
|
struct eigrp_prefix_entry *pe;
|
||||||
struct eigrp *eigrp = eigrp_lookup();
|
struct eigrp *eigrp = eigrp_lookup();
|
||||||
|
|
||||||
|
if (!eigrp)
|
||||||
|
return;
|
||||||
|
|
||||||
if (source == INTERFACE_DOWN_BY_VTY) {
|
if (source == INTERFACE_DOWN_BY_VTY) {
|
||||||
THREAD_OFF(ei->t_hello);
|
THREAD_OFF(ei->t_hello);
|
||||||
eigrp_hello_send(ei, EIGRP_HELLO_GRACEFUL_SHUTDOWN, NULL);
|
eigrp_hello_send(ei, EIGRP_HELLO_GRACEFUL_SHUTDOWN, NULL);
|
||||||
|
@ -182,6 +182,9 @@ void eigrp_prefix_entry_delete(struct route_table *table,
|
|||||||
struct eigrp *eigrp = eigrp_lookup();
|
struct eigrp *eigrp = eigrp_lookup();
|
||||||
struct route_node *rn;
|
struct route_node *rn;
|
||||||
|
|
||||||
|
if (!eigrp)
|
||||||
|
return;
|
||||||
|
|
||||||
rn = route_node_lookup(table, pe->destination);
|
rn = route_node_lookup(table, pe->destination);
|
||||||
if (!rn)
|
if (!rn)
|
||||||
return;
|
return;
|
||||||
@ -426,6 +429,9 @@ void eigrp_topology_update_all_node_flags(struct eigrp *eigrp)
|
|||||||
struct eigrp_prefix_entry *pe;
|
struct eigrp_prefix_entry *pe;
|
||||||
struct route_node *rn;
|
struct route_node *rn;
|
||||||
|
|
||||||
|
if (!eigrp)
|
||||||
|
return;
|
||||||
|
|
||||||
for (rn = route_top(eigrp->topology_table); rn; rn = route_next(rn)) {
|
for (rn = route_top(eigrp->topology_table); rn; rn = route_next(rn)) {
|
||||||
pe = rn->info;
|
pe = rn->info;
|
||||||
|
|
||||||
@ -471,11 +477,15 @@ void eigrp_topology_update_node_flags(struct eigrp_prefix_entry *dest)
|
|||||||
void eigrp_update_routing_table(struct eigrp_prefix_entry *prefix)
|
void eigrp_update_routing_table(struct eigrp_prefix_entry *prefix)
|
||||||
{
|
{
|
||||||
struct eigrp *eigrp = eigrp_lookup();
|
struct eigrp *eigrp = eigrp_lookup();
|
||||||
struct list *successors =
|
struct list *successors;
|
||||||
eigrp_topology_get_successor_max(prefix, eigrp->max_paths);
|
|
||||||
struct listnode *node;
|
struct listnode *node;
|
||||||
struct eigrp_nexthop_entry *entry;
|
struct eigrp_nexthop_entry *entry;
|
||||||
|
|
||||||
|
if (!eigrp)
|
||||||
|
return;
|
||||||
|
|
||||||
|
successors = eigrp_topology_get_successor_max(prefix, eigrp->max_paths);
|
||||||
|
|
||||||
if (successors) {
|
if (successors) {
|
||||||
eigrp_zebra_route_add(prefix->destination, successors);
|
eigrp_zebra_route_add(prefix->destination, successors);
|
||||||
for (ALL_LIST_ELEMENTS_RO(successors, node, entry))
|
for (ALL_LIST_ELEMENTS_RO(successors, node, entry))
|
||||||
|
Loading…
Reference in New Issue
Block a user