summaryrefslogtreecommitdiff
path: root/zebra/zebra_rib.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/zebra_rib.c')
-rw-r--r--zebra/zebra_rib.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index a9f31b1a06..cd9f7005cc 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -1184,6 +1184,9 @@ nexthop_active_check (struct route_node *rn, struct rib *rib,
if (!family)
family = info->afi;
+ memset(&nexthop->rmap_src.ipv6, 0, sizeof(union g_addr));
+ /* It'll get set if required inside */
+
ret = zebra_route_map_check(family, rib->type, &rn->p, nexthop);
if (ret == RMAP_DENYMATCH)
{
@@ -1195,6 +1198,7 @@ nexthop_active_check (struct route_node *rn, struct rib *rib,
}
UNSET_FLAG (nexthop->flags, NEXTHOP_FLAG_ACTIVE);
}
+
return CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_ACTIVE);
}
@@ -1211,6 +1215,7 @@ static int
nexthop_active_update (struct route_node *rn, struct rib *rib, int set)
{
struct nexthop *nexthop;
+ union g_addr prev_src;
unsigned int prev_active, prev_index, new_active, old_num_nh;
old_num_nh = rib->nexthop_active_num;
@@ -1220,12 +1225,18 @@ nexthop_active_update (struct route_node *rn, struct rib *rib, int set)
for (nexthop = rib->nexthop; nexthop; nexthop = nexthop->next)
{
+ /* No protocol daemon provides src and so we're skipping tracking it */
+ prev_src = nexthop->rmap_src;
prev_active = CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_ACTIVE);
prev_index = nexthop->ifindex;
if ((new_active = nexthop_active_check (rn, rib, nexthop, set)))
rib->nexthop_active_num++;
+ /* Don't allow src setting on IPv6 addr for now */
if (prev_active != new_active ||
- prev_index != nexthop->ifindex)
+ prev_index != nexthop->ifindex ||
+ ((nexthop->type >= NEXTHOP_TYPE_IFINDEX &&
+ nexthop->type < NEXTHOP_TYPE_IPV6) &&
+ prev_src.ipv4.s_addr != nexthop->rmap_src.ipv4.s_addr))
{
SET_FLAG (rib->flags, ZEBRA_FLAG_CHANGED);
SET_FLAG (rib->status, RIB_ENTRY_NEXTHOPS_CHANGED);