summaryrefslogtreecommitdiff
path: root/nest
diff options
context:
space:
mode:
Diffstat (limited to 'nest')
-rw-r--r--nest/neighbor.c4
-rw-r--r--nest/rt-attr.c4
2 files changed, 3 insertions, 5 deletions
diff --git a/nest/neighbor.c b/nest/neighbor.c
index d046e981..1a31fb79 100644
--- a/nest/neighbor.c
+++ b/nest/neighbor.c
@@ -253,9 +253,7 @@ neigh_find(struct proto *p, ip_addr a, struct iface *iface, uint flags)
if ((scope < 0) && !(flags & NEF_STICKY))
return NULL;
- n = sl_alloc(neigh_slab);
- memset(n, 0, sizeof(neighbor));
-
+ n = sl_allocz(neigh_slab);
add_tail(&neigh_hash_table[h], &n->n);
add_tail((scope >= 0) ? &iface->neighbors : &sticky_neigh_list, &n->if_n);
n->addr = a;
diff --git a/nest/rt-attr.c b/nest/rt-attr.c
index 28d956bc..25e39488 100644
--- a/nest/rt-attr.c
+++ b/nest/rt-attr.c
@@ -135,7 +135,7 @@ rt_get_source(struct proto *p, u32 id)
if (src)
return src;
- src = sl_alloc(rte_src_slab);
+ src = sl_allocz(rte_src_slab);
src->proto = p;
src->private_id = id;
src->global_id = idm_alloc(&src_ids);
@@ -366,7 +366,7 @@ nexthop_copy(struct nexthop *o)
for (; o; o = o->next)
{
- struct nexthop *n = sl_alloc(nexthop_slab(o));
+ struct nexthop *n = sl_allocz(nexthop_slab(o));
n->gw = o->gw;
n->iface = o->iface;
n->next = NULL;