diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-06-15 21:10:00 +0200 |
---|---|---|
committer | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2019-08-07 03:41:54 +0200 |
commit | 2ea6b572b51e6bc4c8fd197c26d06d9ecd3d1f2d (patch) | |
tree | d7067b975ccda243d2efd64736f1c25e292920ea /eigrpd | |
parent | eigrpd: Remove VRF_DEFAULT from eigrp_fsm.c (diff) | |
download | frr-2ea6b572b51e6bc4c8fd197c26d06d9ecd3d1f2d.tar.xz frr-2ea6b572b51e6bc4c8fd197c26d06d9ecd3d1f2d.zip |
eigrpd: Convert eigrp_neighor.c to not use VRF_DEFAULT
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'eigrpd')
-rw-r--r-- | eigrpd/eigrp_fsm.c | 6 | ||||
-rw-r--r-- | eigrpd/eigrp_neighbor.c | 25 | ||||
-rw-r--r-- | eigrpd/eigrp_neighbor.h | 33 |
3 files changed, 27 insertions, 37 deletions
diff --git a/eigrpd/eigrp_fsm.c b/eigrpd/eigrp_fsm.c index 8b8ea93e8..cc6d47f48 100644 --- a/eigrpd/eigrp_fsm.c +++ b/eigrpd/eigrp_fsm.c @@ -445,7 +445,7 @@ int eigrp_fsm_event_nq_fcn(struct eigrp_fsm_action_message *msg) prefix->rdistance = prefix->distance = prefix->fdistance = ne->distance; prefix->reported_metric = ne->total_metric; - if (eigrp_nbr_count_get()) { + if (eigrp_nbr_count_get(eigrp)) { prefix->req_action |= EIGRP_FSM_NEED_QUERY; listnode_add(eigrp->topology_changes_internalIPV4, prefix); } else { @@ -471,7 +471,7 @@ int eigrp_fsm_event_q_fcn(struct eigrp_fsm_action_message *msg) prefix->state = EIGRP_FSM_STATE_ACTIVE_3; prefix->rdistance = prefix->distance = prefix->fdistance = ne->distance; prefix->reported_metric = ne->total_metric; - if (eigrp_nbr_count_get()) { + if (eigrp_nbr_count_get(eigrp)) { prefix->req_action |= EIGRP_FSM_NEED_QUERY; listnode_add(eigrp->topology_changes_internalIPV4, prefix); } else { @@ -612,7 +612,7 @@ int eigrp_fsm_event_lr_fcn(struct eigrp_fsm_action_message *msg) prefix->rdistance = prefix->distance = best_successor->distance; prefix->reported_metric = best_successor->total_metric; - if (eigrp_nbr_count_get()) { + if (eigrp_nbr_count_get(eigrp)) { prefix->req_action |= EIGRP_FSM_NEED_QUERY; listnode_add(eigrp->topology_changes_internalIPV4, prefix); } else { diff --git a/eigrpd/eigrp_neighbor.c b/eigrpd/eigrp_neighbor.c index 71124dfd0..2ae3997fa 100644 --- a/eigrpd/eigrp_neighbor.c +++ b/eigrpd/eigrp_neighbor.c @@ -194,13 +194,12 @@ void eigrp_nbr_delete(struct eigrp_neighbor *nbr) int holddown_timer_expired(struct thread *thread) { - struct eigrp_neighbor *nbr; - - nbr = THREAD_ARG(thread); + struct eigrp_neighbor *nbr = THREAD_ARG(thread); + struct eigrp *eigrp = nbr->ei->eigrp; zlog_info("Neighbor %s (%s) is down: holding time expired", inet_ntoa(nbr->src), - ifindex2ifname(nbr->ei->ifp->ifindex, VRF_DEFAULT)); + ifindex2ifname(nbr->ei->ifp->ifindex, eigrp->vrf_id)); nbr->state = EIGRP_NEIGHBOR_DOWN; eigrp_nbr_delete(nbr); @@ -297,19 +296,13 @@ void eigrp_nbr_state_update(struct eigrp_neighbor *nbr) } } -int eigrp_nbr_count_get(void) +int eigrp_nbr_count_get(struct eigrp *eigrp) { struct eigrp_interface *iface; struct listnode *node, *node2, *nnode2; struct eigrp_neighbor *nbr; - struct eigrp *eigrp = eigrp_lookup(VRF_DEFAULT); uint32_t counter; - if (eigrp == NULL) { - zlog_debug("EIGRP Routing Process not enabled"); - return 0; - } - counter = 0; for (ALL_LIST_ELEMENTS_RO(eigrp->eiflist, node, iface)) { for (ALL_LIST_ELEMENTS(iface->nbrs, node2, nnode2, nbr)) { @@ -335,20 +328,16 @@ int eigrp_nbr_count_get(void) */ void eigrp_nbr_hard_restart(struct eigrp_neighbor *nbr, struct vty *vty) { - if (nbr == NULL) { - flog_err(EC_EIGRP_CONFIG, - "Nbr Hard restart: Neighbor not specified."); - return; - } + struct eigrp *eigrp = nbr->ei->eigrp; zlog_debug("Neighbor %s (%s) is down: manually cleared", inet_ntoa(nbr->src), - ifindex2ifname(nbr->ei->ifp->ifindex, VRF_DEFAULT)); + ifindex2ifname(nbr->ei->ifp->ifindex, eigrp->vrf_id)); if (vty != NULL) { vty_time_print(vty, 0); vty_out(vty, "Neighbor %s (%s) is down: manually cleared\n", inet_ntoa(nbr->src), - ifindex2ifname(nbr->ei->ifp->ifindex, VRF_DEFAULT)); + ifindex2ifname(nbr->ei->ifp->ifindex, eigrp->vrf_id)); } /* send Hello with Peer Termination TLV */ diff --git a/eigrpd/eigrp_neighbor.h b/eigrpd/eigrp_neighbor.h index 21a8c6a00..1c308fa98 100644 --- a/eigrpd/eigrp_neighbor.h +++ b/eigrpd/eigrp_neighbor.h @@ -33,24 +33,25 @@ #define _ZEBRA_EIGRP_NEIGHBOR_H /* Prototypes */ -extern struct eigrp_neighbor *eigrp_nbr_get(struct eigrp_interface *, - struct eigrp_header *, struct ip *); -extern struct eigrp_neighbor *eigrp_nbr_new(struct eigrp_interface *); -extern void eigrp_nbr_delete(struct eigrp_neighbor *); +extern struct eigrp_neighbor *eigrp_nbr_get(struct eigrp_interface *ei, + struct eigrp_header *, + struct ip *addr); +extern struct eigrp_neighbor *eigrp_nbr_new(struct eigrp_interface *ei); +extern void eigrp_nbr_delete(struct eigrp_neighbor *neigh); -extern int holddown_timer_expired(struct thread *); +extern int holddown_timer_expired(struct thread *thread); -extern int eigrp_neighborship_check(struct eigrp_neighbor *, - struct TLV_Parameter_Type *); -extern void eigrp_nbr_state_update(struct eigrp_neighbor *); -extern void eigrp_nbr_state_set(struct eigrp_neighbor *, uint8_t state); -extern uint8_t eigrp_nbr_state_get(struct eigrp_neighbor *); -extern int eigrp_nbr_count_get(void); -extern const char *eigrp_nbr_state_str(struct eigrp_neighbor *); -extern struct eigrp_neighbor *eigrp_nbr_lookup_by_addr(struct eigrp_interface *, - struct in_addr *); -extern struct eigrp_neighbor *eigrp_nbr_lookup_by_addr_process(struct eigrp *, - struct in_addr); +extern int eigrp_neighborship_check(struct eigrp_neighbor *neigh, + struct TLV_Parameter_Type *tlv); +extern void eigrp_nbr_state_update(struct eigrp_neighbor *neigh); +extern void eigrp_nbr_state_set(struct eigrp_neighbor *neigh, uint8_t state); +extern uint8_t eigrp_nbr_state_get(struct eigrp_neighbor *neigh); +extern int eigrp_nbr_count_get(struct eigrp *eigrp); +extern const char *eigrp_nbr_state_str(struct eigrp_neighbor *neigh); +extern struct eigrp_neighbor * +eigrp_nbr_lookup_by_addr(struct eigrp_interface *ei, struct in_addr *addr); +extern struct eigrp_neighbor * +eigrp_nbr_lookup_by_addr_process(struct eigrp *eigrp, struct in_addr addr); extern void eigrp_nbr_hard_restart(struct eigrp_neighbor *nbr, struct vty *vty); extern int eigrp_nbr_split_horizon_check(struct eigrp_nexthop_entry *ne, |