From 6116e163fc9d1a321be570705cbaa8189c5e4946 Mon Sep 17 00:00:00 2001 From: claudio Date: Mon, 9 Sep 2024 12:59:49 +0000 Subject: [PATCH] Use msgbuf_init() instead of hand initalizing the msgbuf. OK tb@ --- usr.sbin/bgpd/rde.c | 4 ++-- usr.sbin/bgpd/session.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c index d72afb28051..4a284720a1c 100644 --- a/usr.sbin/bgpd/rde.c +++ b/usr.sbin/bgpd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.629 2024/08/28 13:21:39 claudio Exp $ */ +/* $OpenBSD: rde.c,v 1.630 2024/09/09 12:59:49 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -3199,7 +3199,7 @@ rde_dump_mrt_new(struct mrt *mrt, pid_t pid, int fd) return; } memcpy(&ctx->mrt, mrt, sizeof(struct mrt)); - TAILQ_INIT(&ctx->mrt.wbuf.bufs); + msgbuf_init(&ctx->mrt.wbuf); ctx->mrt.wbuf.fd = fd; ctx->mrt.state = MRT_STATE_RUNNING; rid = rib_find(ctx->mrt.rib); diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c index 9548fe191e5..c176edb6797 100644 --- a/usr.sbin/bgpd/session.c +++ b/usr.sbin/bgpd/session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: session.c,v 1.481 2024/08/20 11:59:39 claudio Exp $ */ +/* $OpenBSD: session.c,v 1.482 2024/09/09 12:59:49 claudio Exp $ */ /* * Copyright (c) 2003, 2004, 2005 Henning Brauer @@ -3159,13 +3159,13 @@ session_dispatch_imsg(struct imsgbuf *imsgbuf, int idx, u_int *listener_cnt) if (mrt == NULL) fatal("session_dispatch_imsg"); memcpy(mrt, &xmrt, sizeof(struct mrt)); - TAILQ_INIT(&mrt->wbuf.bufs); + msgbuf_init(&mrt->wbuf); LIST_INSERT_HEAD(&mrthead, mrt, entry); } else { /* old dump reopened */ close(mrt->wbuf.fd); - mrt->wbuf.fd = xmrt.wbuf.fd; } + mrt->wbuf.fd = xmrt.wbuf.fd; break; case IMSG_MRT_CLOSE: if (idx != PFD_PIPE_MAIN) -- 2.20.1