From: claudio Date: Mon, 29 May 2017 13:10:40 +0000 (+0000) Subject: After some consideration, revert last commit and don't abuse rde_dump_done. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=12d81493d6097ee024017813add85fa87c02c818;p=openbsd After some consideration, revert last commit and don't abuse rde_dump_done. IMSG_CTL_SHOW_RIB_PREFIX case is not using rib_dump_r and so should not use rde_dump_done, instead send the IMSG_CTL_END msg and free the ctx directly. This is easier to understand. --- diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c index 3c27e06e1ca..f98da41438d 100644 --- a/usr.sbin/bgpd/rde.c +++ b/usr.sbin/bgpd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.367 2017/05/29 12:48:11 claudio Exp $ */ +/* $OpenBSD: rde.c,v 1.368 2017/05/29 13:10:40 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -2419,7 +2419,9 @@ rde_dump_ctx_new(struct ctl_show_rib_request *req, pid_t pid, re = rib_get(rib, &req->prefix, req->prefixlen); if (re) rde_dump_upcall(re, ctx); - rde_dump_done(ctx); + imsg_compose(ibuf_se_ctl, IMSG_CTL_END, 0, ctx->req.pid, + -1, NULL, 0); + free(ctx); return; default: fatalx("rde_dump_ctx_new: unsupported imsg type"); @@ -2476,12 +2478,7 @@ rde_dump_done(void *arg) imsg_compose(ibuf_se_ctl, IMSG_CTL_END, 0, ctx->req.pid, -1, NULL, 0); - /* - * ctx is not linked for IMSG_CTL_SHOW_RIB_PREFIX because it - * does not need to use rib_dump_r - */ - if (ctx->req.type != IMSG_CTL_SHOW_RIB_PREFIX) - LIST_REMOVE(ctx, entry); + LIST_REMOVE(ctx, entry); free(ctx); }