diff options
Diffstat (limited to 'proto')
-rw-r--r-- | proto/babel/babel.c | 4 | ||||
-rw-r--r-- | proto/babel/packets.c | 2 | ||||
-rw-r--r-- | proto/bfd/bfd.c | 6 | ||||
-rw-r--r-- | proto/bfd/packets.c | 6 | ||||
-rw-r--r-- | proto/bgp/attrs.c | 6 | ||||
-rw-r--r-- | proto/bgp/bgp.c | 15 | ||||
-rw-r--r-- | proto/mrt/mrt.c | 2 | ||||
-rw-r--r-- | proto/ospf/iface.c | 10 | ||||
-rw-r--r-- | proto/ospf/neighbor.c | 4 | ||||
-rw-r--r-- | proto/radv/packets.c | 2 | ||||
-rw-r--r-- | proto/radv/radv.c | 4 | ||||
-rw-r--r-- | proto/rip/packets.c | 2 | ||||
-rw-r--r-- | proto/rip/rip.c | 2 | ||||
-rw-r--r-- | proto/rpki/rpki.c | 2 | ||||
-rw-r--r-- | proto/rpki/transport.c | 2 |
15 files changed, 35 insertions, 34 deletions
diff --git a/proto/babel/babel.c b/proto/babel/babel.c index d398da8e..decaa407 100644 --- a/proto/babel/babel.c +++ b/proto/babel/babel.c @@ -1826,7 +1826,7 @@ babel_add_iface(struct babel_proto *p, struct iface *new, struct babel_iface_con TRACE(D_EVENTS, "Adding interface %s", new->name); - pool *pool = rp_new(p->p.pool, new->name); + pool *pool = rp_new(p->p.pool, proto_domain(&p->p), new->name); ifa = mb_allocz(pool, sizeof(struct babel_iface)); ifa->proto = p; @@ -1881,7 +1881,7 @@ babel_remove_iface(struct babel_proto *p, struct babel_iface *ifa) rem_node(NODE ifa); - rfree(ifa->pool); /* contains ifa itself, locks, socket, etc */ + rp_free(ifa->pool); /* contains ifa itself, locks, socket, etc */ } static int diff --git a/proto/babel/packets.c b/proto/babel/packets.c index d26ee5c6..47d065cd 100644 --- a/proto/babel/packets.c +++ b/proto/babel/packets.c @@ -1680,7 +1680,7 @@ babel_open_socket(struct babel_iface *ifa) err: sk_log_error(sk, p->p.name); - rfree(sk); + sk_close(sk); return 0; } diff --git a/proto/bfd/bfd.c b/proto/bfd/bfd.c index c88c1cb2..f7d8f8d9 100644 --- a/proto/bfd/bfd.c +++ b/proto/bfd/bfd.c @@ -604,10 +604,10 @@ bfd_free_iface(struct bfd_iface *ifa) return; if (ifa->sk) - rfree(ifa->sk); + sk_close(ifa->sk); if (ifa->rx) - rfree(ifa->rx); + sk_close(ifa->rx); rem_node(&ifa->n); mb_free(ifa); @@ -1073,7 +1073,7 @@ bfd_start(struct proto *P) pthread_spin_init(&p->lock, PTHREAD_PROCESS_PRIVATE); - p->tpool = rp_new(P->pool, "BFD loop pool"); + p->tpool = birdloop_pool(P->loop); p->session_slab = sl_new(P->pool, sizeof(struct bfd_session)); HASH_INIT(p->session_hash_id, P->pool, 8); diff --git a/proto/bfd/packets.c b/proto/bfd/packets.c index a22f223b..fa8c328f 100644 --- a/proto/bfd/packets.c +++ b/proto/bfd/packets.c @@ -439,7 +439,7 @@ bfd_open_rx_sk(struct bfd_proto *p, int multihop, int af) err: sk_log_error(sk, p->p.name); - rfree(sk); + sk_close(sk); return NULL; } @@ -470,7 +470,7 @@ bfd_open_rx_sk_bound(struct bfd_proto *p, ip_addr local, struct iface *ifa) err: sk_log_error(sk, p->p.name); - rfree(sk); + sk_close(sk); return NULL; } @@ -501,6 +501,6 @@ bfd_open_tx_sk(struct bfd_proto *p, ip_addr local, struct iface *ifa) err: sk_log_error(sk, p->p.name); - rfree(sk); + sk_close(sk); return NULL; } diff --git a/proto/bgp/attrs.c b/proto/bgp/attrs.c index 8bff4c78..82971c01 100644 --- a/proto/bgp/attrs.c +++ b/proto/bgp/attrs.c @@ -1853,7 +1853,7 @@ bgp_init_pending_tx(struct bgp_channel *c) { ASSERT_DIE(!c->ptx); - pool *p = rp_new(c->pool, "BGP Pending TX"); + pool *p = rp_new(c->pool, proto_domain(c->c.proto), "BGP Pending TX"); c->ptx = ralloc(p, &bgp_pending_tx_class); c->ptx->pool = p; @@ -1867,7 +1867,7 @@ bgp_free_pending_tx(struct bgp_channel *c) ASSERT_DIE(c->ptx); ASSERT_DIE(c->ptx->pool); - rfree(c->ptx->pool); + rp_free(c->ptx->pool); c->ptx = NULL; } @@ -1981,7 +1981,7 @@ bgp_out_table_feed(void *data) static void bgp_out_table_export_start(struct rt_exporter *re, struct rt_export_request *req) { - req->hook = rt_alloc_export(re, sizeof(struct bgp_out_export_hook)); + req->hook = rt_alloc_export(re, req->pool, sizeof(struct bgp_out_export_hook)); req->hook->req = req; struct bgp_out_export_hook *hook = SKIP_BACK(struct bgp_out_export_hook, h, req->hook); diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c index cda0eb8d..e60884ba 100644 --- a/proto/bgp/bgp.c +++ b/proto/bgp/bgp.c @@ -294,7 +294,7 @@ bgp_listen_create(void *_ UNUSED) { sk_log_error(sk, p->p.name); log(L_ERR "%s: Cannot open listening socket", p->p.name); - rfree(sk); + sk_close(sk); UNLOCK_DOMAIN(rtable, bgp_listen_domain); bgp_initiate_disable(p, BEM_NO_SOCKET); @@ -335,7 +335,7 @@ bgp_listen_create(void *_ UNUSED) WALK_LIST_DELSAFE(bs, nxt, bgp_sockets) if (EMPTY_LIST(bs->requests)) { - rfree(bs->sk); + sk_close(bs->sk); rem_node(&bs->n); mb_free(bs); } @@ -465,7 +465,7 @@ bgp_close_conn(struct bgp_conn *conn) rfree(conn->tx_ev); conn->tx_ev = NULL; - rfree(conn->sk); + sk_close(conn->sk); conn->sk = NULL; mb_free(conn->local_caps); @@ -922,7 +922,8 @@ bgp_graceful_restart_feed(struct bgp_channel *c) { c->stale_feed = (struct rt_export_request) { .name = "BGP-GR", - .list = &global_work_list, + .list = proto_event_list(c->c.proto), + .pool = c->c.proto->pool, .trace_routes = c->c.debug | c->c.proto->debug, .dump_req = bgp_graceful_restart_feed_dump_req, .log_state_change = bgp_graceful_restart_feed_log_state_change, @@ -1336,7 +1337,7 @@ bgp_incoming_connection(sock *sk, uint dummy UNUSED) { log(L_WARN "BGP: Unexpected connect from unknown address %I%J (port %d)", sk->daddr, ipa_is_link_local(sk->daddr) ? sk->iface : NULL, sk->dport); - rfree(sk); + sk_close(sk); return 0; } @@ -1370,7 +1371,7 @@ bgp_incoming_connection(sock *sk, uint dummy UNUSED) if (!acc) { - rfree(sk); + sk_close(sk); goto leave; } @@ -1410,7 +1411,7 @@ bgp_incoming_connection(sock *sk, uint dummy UNUSED) err: sk_log_error(sk, p->p.name); log(L_ERR "%s: Incoming connection aborted", p->p.name); - rfree(sk); + sk_close(sk); leave: birdloop_leave(p->p.loop); diff --git a/proto/mrt/mrt.c b/proto/mrt/mrt.c index 82fd426a..92c19b63 100644 --- a/proto/mrt/mrt.c +++ b/proto/mrt/mrt.c @@ -590,7 +590,7 @@ mrt_table_dump_free(struct mrt_table_dump_state *s) config_del_obstacle(s->config); - rfree(s->pool); + rp_free(s->pool); } diff --git a/proto/ospf/iface.c b/proto/ospf/iface.c index 0aa7fa00..c3ec4a4c 100644 --- a/proto/ospf/iface.c +++ b/proto/ospf/iface.c @@ -173,7 +173,7 @@ ospf_sk_open(struct ospf_iface *ifa) err: sk_log_error(sk, p->p.name); - rfree(sk); + sk_close(sk); return 0; } @@ -234,7 +234,7 @@ ospf_open_vlink_sk(struct ospf_proto *p) err: sk_log_error(sk, p->p.name); log(L_ERR "%s: Cannot open virtual link socket", p->p.name); - rfree(sk); + sk_close(sk); } static void @@ -311,7 +311,7 @@ ospf_iface_remove(struct ospf_iface *ifa) ospf_iface_sm(ifa, ISM_DOWN); rem_node(NODE ifa); - rfree(ifa->pool); + rp_free(ifa->pool); } void @@ -567,7 +567,7 @@ ospf_iface_new(struct ospf_area *oa, struct ifa *addr, struct ospf_iface_patt *i OSPF_TRACE(D_EVENTS, "Adding interface %s (%N) to area %R", iface->name, &addr->prefix, oa->areaid); - pool = rp_new(p->p.pool, "OSPF Interface"); + pool = rp_new(p->p.pool, proto_domain(&p->p), "OSPF Interface"); ifa = mb_allocz(pool, sizeof(struct ospf_iface)); ifa->iface = iface; ifa->addr = addr; @@ -690,7 +690,7 @@ ospf_iface_new_vlink(struct ospf_proto *p, struct ospf_iface_patt *ip) /* Vlink ifname is stored just after the ospf_iface structure */ - pool = rp_new(p->p.pool, "OSPF Vlink"); + pool = rp_new(p->p.pool, proto_domain(&p->p), "OSPF Vlink"); ifa = mb_allocz(pool, sizeof(struct ospf_iface) + 16); ifa->oa = p->backbone; ifa->cf = ip; diff --git a/proto/ospf/neighbor.c b/proto/ospf/neighbor.c index b0fdc42f..59a60587 100644 --- a/proto/ospf/neighbor.c +++ b/proto/ospf/neighbor.c @@ -80,7 +80,7 @@ struct ospf_neighbor * ospf_neighbor_new(struct ospf_iface *ifa) { struct ospf_proto *p = ifa->oa->po; - struct pool *pool = rp_new(p->p.pool, "OSPF Neighbor"); + struct pool *pool = rp_new(p->p.pool, proto_domain(&p->p), "OSPF Neighbor"); struct ospf_neighbor *n = mb_allocz(pool, sizeof(struct ospf_neighbor)); n->pool = pool; @@ -120,7 +120,7 @@ ospf_neigh_down(struct ospf_neighbor *n) s_get(&(n->dbsi)); release_lsrtl(p, n); rem_node(NODE n); - rfree(n->pool); + rp_free(n->pool); OSPF_TRACE(D_EVENTS, "Neighbor %R on %s removed", rid, ifa->ifname); } diff --git a/proto/radv/packets.c b/proto/radv/packets.c index c6b565d2..d1d8663f 100644 --- a/proto/radv/packets.c +++ b/proto/radv/packets.c @@ -511,7 +511,7 @@ radv_sk_open(struct radv_iface *ifa) err: sk_log_error(sk, ifa->ra->p.name); - rfree(sk); + sk_close(sk); return 0; } diff --git a/proto/radv/radv.c b/proto/radv/radv.c index 434155dc..3d5fe5a3 100644 --- a/proto/radv/radv.c +++ b/proto/radv/radv.c @@ -287,7 +287,7 @@ radv_iface_new(struct radv_proto *p, struct iface *iface, struct radv_iface_conf RADV_TRACE(D_EVENTS, "Adding interface %s", iface->name); - pool *pool = rp_new(p->p.pool, iface->name); + pool *pool = rp_new(p->p.pool, proto_domain(&p->p), iface->name); ifa = mb_allocz(pool, sizeof(struct radv_iface)); ifa->pool = pool; ifa->ra = p; @@ -323,7 +323,7 @@ radv_iface_remove(struct radv_iface *ifa) rem_node(NODE ifa); - rfree(ifa->pool); + rp_free(ifa->pool); } static void diff --git a/proto/rip/packets.c b/proto/rip/packets.c index fecdf896..70108ac3 100644 --- a/proto/rip/packets.c +++ b/proto/rip/packets.c @@ -1040,6 +1040,6 @@ rip_open_socket(struct rip_iface *ifa) err: sk_log_error(sk, p->p.name); - rfree(sk); + sk_close(sk); return 0; } diff --git a/proto/rip/rip.c b/proto/rip/rip.c index d15177da..dded05c7 100644 --- a/proto/rip/rip.c +++ b/proto/rip/rip.c @@ -750,7 +750,7 @@ rip_remove_iface(struct rip_proto *p, struct rip_iface *ifa) rem_node(NODE ifa); - rfree(ifa->sk); + sk_close(ifa->sk); rfree(ifa->lock); rfree(ifa->timer); diff --git a/proto/rpki/rpki.c b/proto/rpki/rpki.c index e5638aff..0fd686b3 100644 --- a/proto/rpki/rpki.c +++ b/proto/rpki/rpki.c @@ -599,7 +599,7 @@ rpki_check_expire_interval(uint seconds) static struct rpki_cache * rpki_init_cache(struct rpki_proto *p, struct rpki_config *cf) { - pool *pool = rp_new(p->p.pool, cf->hostname); + pool *pool = rp_new(p->p.pool, proto_domain(&p->p), cf->hostname); struct rpki_cache *cache = mb_allocz(pool, sizeof(struct rpki_cache)); diff --git a/proto/rpki/transport.c b/proto/rpki/transport.c index 81bd6dd8..8c6dcc11 100644 --- a/proto/rpki/transport.c +++ b/proto/rpki/transport.c @@ -120,7 +120,7 @@ rpki_tr_close(struct rpki_tr_sock *tr) if (tr->sk) { - rfree(tr->sk); + sk_close(tr->sk); tr->sk = NULL; } } |