Let's just track the NHEs we get from the kernel(dplane) for
ID usage with internal routes. I tried to be smart originally
and allow them to be re-used internal to zebra but its proving
to cause more bugs than it's worth.
This doesn't break any functionality. It just means we won't
use NHEs we get from the kernel with our routes, we will create
new ones.
Decided this based on various bugs seen ith the lastest one
being on startup with this kernel state:
```
[root@alfred frr-2]# ip next ls
id 15 via 192.168.161.1 dev doof scope link proto zebra
id 17 group 15 proto zebra
[root@alfred frr-2]# ip ro show 3.3.3.1
3.3.3.1 nhid 17 via 192.168.161.1 dev doof
```
Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
if (lookup->id == 0)
lookup->id = nhg_get_next_id();
- if (lookup->id < ZEBRA_NHG_PROTO_LOWER) {
+ if (!from_dplane && lookup->id < ZEBRA_NHG_PROTO_LOWER) {
/*
* This is a zebra hashed/owned NHG.
*
zebra_nhg_insert_id(newnhe);
} else {
/*
- * This is upperproto owned NHG and should not be hashed to.
+ * This is upperproto owned NHG or one we read in from dataplane
+ * and should not be hashed to.
*
* It goes in ID table.
*/
lookup.nhg = *nhg;
lookup.vrf_id = vrf_id;
- if (lookup.nhg.nexthop->next) {
+ if (nhg_depends || lookup.nhg.nexthop->next) {
/* Groups can have all vrfs and AF's in them */
lookup.afi = AFI_UNSPEC;
} else {