summaryrefslogtreecommitdiff
path: root/proto
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2020-11-24 03:21:44 +0100
committerOndrej Zajicek (work) <santiago@crfreenet.org>2020-11-24 03:21:44 +0100
commitc9ae81656f97bcc55910e80b6f00d3ee9383d848 (patch)
treeeab1d953cc77e3644fe6f5d0bdae9e088210b98d /proto
parentdb2d29073acfd4086fca18ba43a5ed6baccaa8ad (diff)
Some minor sl_allocz() cleanups
Diffstat (limited to 'proto')
-rw-r--r--proto/bfd/bfd.c4
-rw-r--r--proto/bgp/attrs.c1
-rw-r--r--proto/ospf/topology.c4
3 files changed, 3 insertions, 6 deletions
diff --git a/proto/bfd/bfd.c b/proto/bfd/bfd.c
index a8814382..8dfca790 100644
--- a/proto/bfd/bfd.c
+++ b/proto/bfd/bfd.c
@@ -423,9 +423,7 @@ bfd_add_session(struct bfd_proto *p, ip_addr addr, ip_addr local, struct iface *
struct bfd_iface *ifa = bfd_get_iface(p, local, iface);
- struct bfd_session *s = sl_alloc(p->session_slab);
- bzero(s, sizeof(struct bfd_session));
-
+ struct bfd_session *s = sl_allocz(p->session_slab);
s->addr = addr;
s->ifa = ifa;
s->loc_id = bfd_get_free_id(p);
diff --git a/proto/bgp/attrs.c b/proto/bgp/attrs.c
index 4710bfba..828bc118 100644
--- a/proto/bgp/attrs.c
+++ b/proto/bgp/attrs.c
@@ -1603,6 +1603,7 @@ bgp_get_prefix(struct bgp_channel *c, net_addr *net, u32 path_id)
px->buck_node.next = NULL;
px->buck_node.prev = NULL;
+ px->next = NULL;
px->hash = hash;
px->path_id = path_id;
net_copy(px->net, net);
diff --git a/proto/ospf/topology.c b/proto/ospf/topology.c
index ea7176fd..52c2a0ce 100644
--- a/proto/ospf/topology.c
+++ b/proto/ospf/topology.c
@@ -2108,9 +2108,7 @@ ospf_hash_get(struct top_graph *f, u32 domain, u32 lsa, u32 rtr, u32 type)
if (e)
return e;
- e = sl_alloc(f->hash_slab);
- bzero(e, sizeof(struct top_hash_entry));
-
+ e = sl_allocz(f->hash_slab);
e->color = OUTSPF;
e->dist = LSINFINITY;
e->lsa.type_raw = type;