diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2024-08-20 11:59:40 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2024-08-20 11:59:40 +0000 |
commit | 61fbc609c384ee73168e65f5afb6f8148c583432 (patch) | |
tree | 6929ef75ce5a42a236c517800a693c35c1a564c5 /usr.sbin/bgpd/rde.c | |
parent | 7f11f484cd38a7f6f7af94f14da66642ce0072a1 (diff) |
Use msgbuf_queuelen() instead of accessing wbuf.queue for msgbuf structs.
Also export the msgbuf queue len as a stats member so bgpctl does not need
to dig into the msgbuf structure inside struct peer.
This skips imsg related msgbuf since that will be handled by a imsgbuf
specific function.
OK tb@
Diffstat (limited to 'usr.sbin/bgpd/rde.c')
-rw-r--r-- | usr.sbin/bgpd/rde.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c index c4c286e4f29..81c1084dfb6 100644 --- a/usr.sbin/bgpd/rde.c +++ b/usr.sbin/bgpd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.626 2024/08/14 19:09:51 claudio Exp $ */ +/* $OpenBSD: rde.c,v 1.627 2024/08/20 11:59:39 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -245,7 +245,7 @@ rde_main(int debug, int verbose) if (i >= pfd_elms) fatalx("poll pfd too small"); - if (mctx->mrt.wbuf.queued) { + if (msgbuf_queuelen(&mctx->mrt.wbuf) > 0) { pfd[i].fd = mctx->mrt.wbuf.fd; pfd[i].events = POLLOUT; i++; @@ -3175,7 +3175,7 @@ rde_mrt_throttled(void *arg) { struct mrt *mrt = arg; - return (mrt->wbuf.queued > SESS_MSG_LOW_MARK); + return (msgbuf_queuelen(&mrt->wbuf) > SESS_MSG_LOW_MARK); } static void |