]> git.proxmox.com Git - mirror_frr.git/commitdiff
pbrd: Set next/prev to NULL on cached nexthops
authorStephen Worley <sworley@cumulusnetworks.com>
Mon, 10 Jun 2019 04:36:59 +0000 (00:36 -0400)
committerStephen Worley <sworley@cumulusnetworks.com>
Mon, 10 Jun 2019 18:36:30 +0000 (14:36 -0400)
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>
pbrd/pbr_nht.c

index fc78b8ed1f54a1d502ccf5428b5debd0bb960219..a6ee8bf01e8977a97e2e128b039448a878640e87 100644 (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;
 }