From ad9255f8feb75c021ad12a65f4dfa9015abb64e7 Mon Sep 17 00:00:00 2001 From: Stephen Worley Date: Mon, 10 Jun 2019 00:36:59 -0400 Subject: [PATCH] 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 --- pbrd/pbr_nht.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pbrd/pbr_nht.c b/pbrd/pbr_nht.c index fc78b8ed1f..a6ee8bf01e 100644 --- a/pbrd/pbr_nht.c +++ b/pbrd/pbr_nht.c @@ -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; }