#include "log.h"
#include "memory.h"
+#include "zebra/debug.h"
#include "zebra/zserv.h"
#include "zebra/redistribute.h"
#include "zebra/interface.h"
rib_add_ipv4 (ZEBRA_ROUTE_CONNECT, 0, 0, &p, NULL, NULL, ifp->ifindex,
RT_TABLE_MAIN, ifp->metric, 0, SAFI_MULTICAST);
+ if (IS_ZEBRA_DEBUG_RIB)
+ zlog_debug ("%s: calling rib_update", __func__);
+
rib_update ();
}
rib_delete_ipv4 (ZEBRA_ROUTE_CONNECT, 0, 0, &p, NULL, ifp->ifindex, 0, SAFI_MULTICAST);
- rib_update ();
+ if (IS_ZEBRA_DEBUG_RIB)
+ zlog_debug ("%s: calling rib_update_static", __func__);
+
+ rib_update_static ();
}
void
connected_withdraw (ifc);
- rib_update();
+ if (IS_ZEBRA_DEBUG_RIB)
+ zlog_debug ("%s: calling rib_update_static", __func__);
+
+ rib_update_static();
}
#ifdef HAVE_IPV6
rib_add_ipv6 (ZEBRA_ROUTE_CONNECT, 0, 0, &p, NULL, ifp->ifindex, RT_TABLE_MAIN,
ifp->metric, 0, SAFI_UNICAST);
+ if (IS_ZEBRA_DEBUG_RIB)
+ zlog_debug ("%s: calling rib_update", __func__);
+
rib_update ();
}
rib_delete_ipv6 (ZEBRA_ROUTE_CONNECT, 0, 0, &p, NULL, ifp->ifindex, 0, SAFI_UNICAST);
- rib_update ();
+ if (IS_ZEBRA_DEBUG_RIB)
+ zlog_debug ("%s: calling rib_update_static", __func__);
+
+ rib_update_static ();
}
void
connected_withdraw (ifc);
- rib_update();
+ if (IS_ZEBRA_DEBUG_RIB)
+ zlog_debug ("%s: calling rib_update_static", __func__);
+
+ rib_update_static();
}
#endif /* HAVE_IPV6 */
}
}
+ if (IS_ZEBRA_DEBUG_RIB)
+ zlog_debug ("%s: calling rib_update on interface %s up", __func__,
+ ifp->name);
+
/* Examine all static routes. */
rib_update ();
}
}
/* Examine all static routes which direct to the interface. */
- rib_update ();
+ if (IS_ZEBRA_DEBUG_RIB)
+ zlog_debug ("%s: calling rib_update_static on interface %s down", __func__,
+ ifp->name);
+
+ rib_update_static ();
if_nbr_ipv6ll_to_ipv4ll_neigh_del_all (ifp);
extern struct rib *rib_lookup_ipv4 (struct prefix_ipv4 *);
extern void rib_update (void);
+extern void rib_update_static (void);
extern void rib_weed_tables (void);
extern void rib_sweep_route (void);
extern void rib_close (void);
}
#endif /* HAVE_IPV6 */
+/* RIB update function. */
+void
+rib_update_static (void)
+{
+ struct route_node *rn;
+ struct route_table *table;
+ struct rib *rib, *next;
+
+ table = vrf_table (AFI_IP, SAFI_UNICAST, 0);
+ if (table)
+ for (rn = route_top (table); rn; rn = route_next (rn))
+ RNODE_FOREACH_RIB_SAFE (rn, rib, next)
+ if (rib->type == ZEBRA_ROUTE_STATIC)
+ {
+ rib_queue_add (&zebrad, rn);
+ break;
+ }
+
+ table = vrf_table (AFI_IP6, SAFI_UNICAST, 0);
+ if (table)
+ for (rn = route_top (table); rn; rn = route_next (rn))
+ RNODE_FOREACH_RIB_SAFE (rn, rib, next)
+ if (rib->type == ZEBRA_ROUTE_STATIC)
+ {
+ rib_queue_add (&zebrad, rn);
+ break;
+ }
+}
+
/* RIB update function. */
void
rib_update (void)
XFREE (MTYPE_ROUTE_MAP_NAME, proto_rm[AFI_IP][i]);
}
proto_rm[AFI_IP][i] = XSTRDUP (MTYPE_ROUTE_MAP_NAME, argv[1]);
+
+ if (IS_ZEBRA_DEBUG_RIB)
+ zlog_debug ("%s: calling rib_update", __func__);
+
rib_update();
return CMD_SUCCESS;
}
{
XFREE (MTYPE_ROUTE_MAP_NAME, proto_rm[AFI_IP][i]);
proto_rm[AFI_IP][i] = NULL;
+
+ if (IS_ZEBRA_DEBUG_RIB)
+ zlog_debug ("%s: calling rib_update", __func__);
+
rib_update();
}
return CMD_SUCCESS;
XFREE (MTYPE_ROUTE_MAP_NAME, proto_rm[AFI_IP6][i]);
}
proto_rm[AFI_IP6][i] = XSTRDUP (MTYPE_ROUTE_MAP_NAME, argv[1]);
+
+ if (IS_ZEBRA_DEBUG_RIB)
+ zlog_debug ("%s: calling rib_update", __func__);
+
rib_update();
return CMD_SUCCESS;
}
{
XFREE (MTYPE_ROUTE_MAP_NAME, proto_rm[AFI_IP6][i]);
proto_rm[AFI_IP6][i] = NULL;
+
+ if (IS_ZEBRA_DEBUG_RIB)
+ zlog_debug ("%s: calling rib_update", __func__);
+
rib_update();
}
return CMD_SUCCESS;
if (IS_ZEBRA_DEBUG_EVENT)
zlog_debug("Event driven route-map update triggered");
+ if (IS_ZEBRA_DEBUG_RIB)
+ zlog_debug ("%s: calling rib_update", __func__);
+
rib_update();
zebra_evaluate_rnh(0, AF_INET, 1, RNH_NEXTHOP_TYPE, NULL);
zebra_evaluate_rnh(0, AF_INET6, 1, RNH_NEXTHOP_TYPE, NULL);