From: Donald Sharp Date: Tue, 22 Aug 2017 18:40:24 +0000 (-0400) Subject: eigrpd: Start split-horizon X-Git-Tag: frr-4.0-dev~375^2~17 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=cd0442479369e53f3b8451163a8679a00f4c0d25;p=matthieu%2Ffrr.git eigrpd: Start split-horizon EIGRP was not handling split-horizon. This code starts down the path of properly considering it. There still exists situations where we are not properly handling it though. Signed-off-by: Donald Sharp --- diff --git a/eigrpd/eigrp_neighbor.c b/eigrpd/eigrp_neighbor.c index d5fc6a2996..5d78dc375c 100644 --- a/eigrpd/eigrp_neighbor.c +++ b/eigrpd/eigrp_neighbor.c @@ -357,3 +357,11 @@ void eigrp_nbr_hard_restart(struct eigrp_neighbor *nbr, struct vty *vty) /* delete neighbor */ eigrp_nbr_delete(nbr); } + +int eigrp_nbr_split_horizon_check(struct eigrp_neighbor_entry *ne, struct eigrp_interface *ei) +{ + if (ne->distance == EIGRP_MAX_METRIC) + return 0; + + return (ne->ei == ei); +} diff --git a/eigrpd/eigrp_neighbor.h b/eigrpd/eigrp_neighbor.h index 006aa9ab75..6467fb24a9 100644 --- a/eigrpd/eigrp_neighbor.h +++ b/eigrpd/eigrp_neighbor.h @@ -53,4 +53,6 @@ extern struct eigrp_neighbor *eigrp_nbr_lookup_by_addr_process(struct eigrp *, struct in_addr); extern void eigrp_nbr_hard_restart(struct eigrp_neighbor *nbr, struct vty *vty); +extern int eigrp_nbr_split_horizon_check(struct eigrp_neighbor_entry *ne, + struct eigrp_interface *ei); #endif /* _ZEBRA_EIGRP_NEIGHBOR_H */ diff --git a/eigrpd/eigrp_update.c b/eigrpd/eigrp_update.c index d0c6520c4e..2934c6c652 100644 --- a/eigrpd/eigrp_update.c +++ b/eigrpd/eigrp_update.c @@ -610,8 +610,7 @@ void eigrp_update_send_EOT(struct eigrp_neighbor *nbr) for (ALL_LIST_ELEMENTS(nbr->ei->eigrp->topology_table, node, nnode, pe)) { for (ALL_LIST_ELEMENTS(pe->entries, node2, nnode2, te)) { - if ((te->ei == nbr->ei) - && (te->prefix->nt == EIGRP_TOPOLOGY_TYPE_REMOTE)) + if (eigrp_nbr_split_horizon_check(te, nbr->ei)) continue; if ((length + 0x001D) > (u_int16_t)nbr->ei->ifp->mtu) { @@ -701,10 +700,15 @@ void eigrp_update_send(struct eigrp_interface *ei) has_tlv = 0; for (ALL_LIST_ELEMENTS(ei->eigrp->topology_changes_internalIPV4, node, nnode, pe)) { + struct eigrp_neighbor_entry *ne; if (!(pe->req_action & EIGRP_FSM_NEED_UPDATE)) continue; + ne = listnode_head(pe->entries); + if (eigrp_nbr_split_horizon_check(ne, ei)) + continue; + if ((length + 0x001D) > (u_int16_t)ei->ifp->mtu) { if ((IF_DEF_PARAMS(ei->ifp)->auth_type == EIGRP_AUTH_TYPE_MD5) && (IF_DEF_PARAMS(ei->ifp)->auth_keychain != NULL)) {