summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2019-10-10 14:01:16 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2019-10-10 14:01:16 +0200
commitcb2b6e0494e685fc4cce52a1d449ffd69bec351e (patch)
treed1fda662ef07bc9ad1df53ac21c90263028d4bb2
parent09ee846d9275b4cb0b77f7e458aba6a71b111c52 (diff)
Nest: Fix recursive route update
Missing cleanup can lead to dangling pointer to old next hops.
-rw-r--r--nest/rt-table.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/nest/rt-table.c b/nest/rt-table.c
index b55bcd40..97a5d1bc 100644
--- a/nest/rt-table.c
+++ b/nest/rt-table.c
@@ -2109,9 +2109,10 @@ no_nexthop:
else
{
nhr = nhp;
- nhp = (nhp ? (nhp->next = lp_allocz(rte_update_pool, NEXTHOP_MAX_SIZE)) : &(a->nh));
+ nhp = (nhp ? (nhp->next = lp_alloc(rte_update_pool, NEXTHOP_MAX_SIZE)) : &(a->nh));
}
+ memset(nhp, 0, NEXTHOP_MAX_SIZE);
nhp->iface = nh->iface;
nhp->weight = nh->weight;
if (mls)