summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2021-07-16 09:33:52 -0400
committerGitHub <noreply@github.com>2021-07-16 09:33:52 -0400
commit12e1fe1251db5a26e00c6b48b084a25b69c014e5 (patch)
tree52a8c406c51a7f6c2431e4f3a93ef8d00ba83087
parent9d37889de09cf1d4bec958b95e0303cd82603027 (diff)
parentbf157b9263050b25228e66164c1540bf823b960a (diff)
Merge pull request #9063 from sworleys/Fix-IFP-NHG
zebra: fix ifp pointer for groups/recursives
-rw-r--r--zebra/zebra_nhg.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/zebra/zebra_nhg.c b/zebra/zebra_nhg.c
index af86263a16..46d5164127 100644
--- a/zebra/zebra_nhg.c
+++ b/zebra/zebra_nhg.c
@@ -453,8 +453,13 @@ static void *zebra_nhg_hash_alloc(void *arg)
/* Mark duplicate nexthops in a group at creation time. */
nexthop_group_mark_duplicates(&(nhe->nhg));
- /* Add the ifp now if it's not a group or recursive and has ifindex */
- if (nhe->nhg.nexthop && nhe->nhg.nexthop->ifindex) {
+ /*
+ * Add the ifp now if it's not a group or recursive and has ifindex.
+ *
+ * A proto-owned ID is always a group.
+ */
+ if (!PROTO_OWNED(nhe) && nhe->nhg.nexthop && !nhe->nhg.nexthop->next
+ && !nhe->nhg.nexthop->resolved && nhe->nhg.nexthop->ifindex) {
struct interface *ifp = NULL;
ifp = if_lookup_by_index(nhe->nhg.nexthop->ifindex,