]> git.puffer.fish Git - matthieu/frr.git/commitdiff
eigrpd: Start split-horizon
authorDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 22 Aug 2017 18:40:24 +0000 (14:40 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 24 Aug 2017 12:04:20 +0000 (08:04 -0400)
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 <sharpd@cumulusnetworks.com>
eigrpd/eigrp_neighbor.c
eigrpd/eigrp_neighbor.h
eigrpd/eigrp_update.c

index d5fc6a299678440e57005e94cfeddf8e4daf18e3..5d78dc375c68fb6a13346e80f153e8f509c0100e 100644 (file)
@@ -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);
+}
index 006aa9ab75ee54480981c06c49a14bd5c670fbf5..6467fb24a90cbdf77a6dad53061e6ca9b101eadd 100644 (file)
@@ -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 */
index d0c6520c4e675e293a8d0b451794c1544d22c97a..2934c6c652c3b44c412e32972b858e368af65026 100644 (file)
@@ -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)) {