]> git.puffer.fish Git - mirror/frr.git/commitdiff
eigrpd: Fix up some redistribution issues 818/head
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 13 Jul 2017 22:58:31 +0000 (18:58 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 13 Jul 2017 22:58:31 +0000 (18:58 -0400)
Get EIGRP to start attempting to redistribute routes
as well as to display the fact it thinks it is redistributed.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
eigrpd/eigrp_vty.c
eigrpd/eigrp_zebra.c
eigrpd/eigrp_zebra.h

index e283c7365302eb2636f5f0f6f369fa2adf5de7ca..7745e9abbd7c18940bca5d2bb9f9cf391639bedc 100644 (file)
@@ -59,6 +59,7 @@ static int
 config_write_network (struct vty *vty, struct eigrp *eigrp)
 {
   struct route_node *rn;
+  int i;
 
   /* `network area' print. */
   for (rn = route_top (eigrp->networks); rn; rn = route_next (rn))
@@ -75,6 +76,11 @@ config_write_network (struct vty *vty, struct eigrp *eigrp)
   if (eigrp->variance != EIGRP_VARIANCE_DEFAULT)
     vty_outln (vty, " variance %d", eigrp->variance);
 
+  for (i = 0; i < ZEBRA_ROUTE_MAX; i++)
+    if (i != zclient->redist_default &&
+       vrf_bitmap_check (zclient->redist[AFI_IP][i], VRF_DEFAULT))
+       vty_outln (vty, " redistribute %s", zebra_route_string(i));
+
   /*Separate EIGRP configuration from the rest of the config*/
   vty_outln (vty, "!");
 
index 2baad75265117ff74989913c6ea3125e6bf42d1e..38ce757cd092d2908338422a38b35b0ac5a57687 100644 (file)
@@ -496,11 +496,12 @@ eigrp_zebra_route_delete (struct prefix_ipv4 *p)
   return;
 }
 
-vrf_bitmap_t
+int
 eigrp_is_type_redistributed (int type)
 {
-  return (DEFAULT_ROUTE_TYPE (type)) ?
-    zclient->default_information : zclient->redist[AFI_IP][type];
+  return ((DEFAULT_ROUTE_TYPE (type)) ?
+         vrf_bitmap_check (zclient->default_information, VRF_DEFAULT) :
+         vrf_bitmap_check (zclient->redist[AFI_IP][type], VRF_DEFAULT));
 }
 
 int
@@ -528,11 +529,6 @@ eigrp_redistribute_set (struct eigrp *eigrp, int type, struct eigrp_metrics metr
   zclient_redistribute (ZEBRA_REDISTRIBUTE_ADD, zclient,
                         AFI_IP, type, 0, VRF_DEFAULT);
 
-  //  if (IS_DEBUG_EIGRP (zebra, ZEBRA_REDISTRIBUTE))
-  //    zlog_debug ("Redistribute[%s]: Start  Type[%d], Metric[%d]",
-  //               ospf_redist_string(type),
-  //               metric_type (ospf, type), metric_value (ospf, type));
-
   ++eigrp->redistribute;
 
   return CMD_SUCCESS;
@@ -550,11 +546,6 @@ eigrp_redistribute_unset (struct eigrp *eigrp, int type)
       --eigrp->redistribute;
     }
 
-  //  if (IS_DEBUG_EIGRP (zebra, ZEBRA_REDISTRIBUTE))
-  //    zlog_debug ("Redistribute[%s]: Start  Type[%d], Metric[%d]",
-  //               ospf_redist_string(type),
-  //               metric_type (ospf, type), metric_value (ospf, type));
-
   return CMD_SUCCESS;
 }
 
index 0991d35aba26ee37e2f4e93bbfc20868c2fa0b97..6151e32724cacccee779374048bec3e6147a00a7 100644 (file)
@@ -37,6 +37,6 @@ extern void eigrp_zebra_route_add (struct prefix_ipv4 *, struct list *);
 extern void eigrp_zebra_route_delete (struct prefix_ipv4 *);
 extern int eigrp_redistribute_set (struct eigrp *, int, struct eigrp_metrics);
 extern int eigrp_redistribute_unset (struct eigrp *, int);
-extern vrf_bitmap_t eigrp_is_type_redistributed (int);
+extern int eigrp_is_type_redistributed (int);
 
 #endif /* _ZEBRA_EIGRP_ZEBRA_H_ */