Commit c9ae8165 authored by Ondrej Zajicek (work)'s avatar Ondrej Zajicek (work)
Browse files

Some minor sl_allocz() cleanups

parent db2d2907
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -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;
+2 −2
Original line number Diff line number Diff line
@@ -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;
+1 −3
Original line number Diff line number Diff line
@@ -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);
+1 −0
Original line number Diff line number Diff line
@@ -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);
+1 −3
Original line number Diff line number Diff line
@@ -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;