pbrd: Set next/prev to NULL on cached nexthops

When we copy a new nexthop to cache and track, set its
next and prev pointers to NULL. We don't want those since
this is to be treated as a single nexthop.Other nexthops that
aren't in a group could hash to this nexthop so it doesn't
make sense to keep those pointers in the cache.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
This commit is contained in:
Stephen Worley 2019-06-10 00:36:59 -04:00
parent 82e16a13e5
commit ad9255f8fe

View File

@ -66,6 +66,8 @@ static void *pbr_nhrc_hash_alloc(void *p)
{
struct nhrc *nhrc = XCALLOC(MTYPE_PBR_NHG, sizeof(struct nhrc));
nhrc->nexthop = *(struct nexthop *)p;
nhrc->nexthop.next = NULL;
nhrc->nexthop.prev = NULL;
return nhrc;
}