summaryrefslogtreecommitdiff
path: root/zebra/zebra_rib.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2017-09-03 17:59:14 -0400
committerGitHub <noreply@github.com>2017-09-03 17:59:14 -0400
commit650e74d71a2faa6536de4d3043aebe306ee3db1d (patch)
treeef920bad56027acd8e6a0cfe2b88123694e6e1e4 /zebra/zebra_rib.c
parentd8ed14299c2dc24245c7251c53d6b12335da3a4b (diff)
parent5f20552d51647a7ab672b9e7dbdf7de757c9fb29 (diff)
Merge pull request #1090 from opensourcerouting/rib_issues
RIB issues
Diffstat (limited to 'zebra/zebra_rib.c')
-rw-r--r--zebra/zebra_rib.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index bcf21783ae..deb434bd35 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -2061,10 +2061,9 @@ void _route_entry_dump(const char *func, union prefixconstptr pp,
is_srcdst ? prefix2str(src_pp, srcaddr, sizeof(srcaddr))
: "",
re->vrf_id);
- zlog_debug(
- "%s: refcnt == %lu, uptime == %lu, type == %u, instance == %d, table == %d",
- func, re->refcnt, (unsigned long)re->uptime, re->type,
- re->instance, re->table);
+ zlog_debug("%s: uptime == %lu, type == %u, instance == %d, table == %d",
+ func, (unsigned long)re->uptime, re->type, re->instance,
+ re->table);
zlog_debug(
"%s: metric == %u, mtu == %u, distance == %u, flags == %u, status == %u",
func, re->metric, re->mtu, re->distance, re->flags, re->status);
@@ -2335,12 +2334,6 @@ void rib_delete(afi_t afi, safi_t safi, vrf_id_t vrf_id, int type,
&& rtnh->type == NEXTHOP_TYPE_IFINDEX && nh) {
if (rtnh->ifindex != nh->ifindex)
continue;
- if (re->refcnt) {
- re->refcnt--;
- route_unlock_node(rn);
- route_unlock_node(rn);
- return;
- }
same = re;
break;
}
@@ -2476,13 +2469,16 @@ int rib_add(afi_t afi, safi_t safi, vrf_id_t vrf_id, int type, u_short instance,
break;
}
/* Duplicate system route comes in. */
- else if ((rtnh = re->nexthop)
- && rtnh->type == NEXTHOP_TYPE_IFINDEX
- && rtnh->ifindex == nh->ifindex
- && !CHECK_FLAG(re->status, ROUTE_ENTRY_REMOVED)) {
- re->refcnt++;
+ rtnh = re->nexthop;
+ if (nexthop_same_no_recurse(rtnh, nh))
return 0;
- }
+ /*
+ * Nexthop is different. Remove the old route unless it's
+ * a link-local route.
+ */
+ else if (afi != AFI_IP6
+ || !IN6_IS_ADDR_LINKLOCAL(&p->u.prefix6))
+ same = re;
}
/* Allocate new re structure. */