summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2024-11-21 13:20:01 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2024-11-21 13:20:01 +0000
commit3212912058936b9a37844be14346b63402008d5c (patch)
tree814535613c20c49627d7626b4f254326da3ad45b
parentda796e233a67a0517be79471c0b48a89d010ff98 (diff)
Use msgbuf_queuelen() where approriate
OK tb@
-rw-r--r--usr.sbin/ldpd/ldpd.c4
-rw-r--r--usr.sbin/ldpd/packet.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/ldpd/ldpd.c b/usr.sbin/ldpd/ldpd.c
index ad22d548546..8b26b02e1e2 100644
--- a/usr.sbin/ldpd/ldpd.c
+++ b/usr.sbin/ldpd/ldpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldpd.c,v 1.74 2024/11/21 13:18:38 claudio Exp $ */
+/* $OpenBSD: ldpd.c,v 1.75 2024/11/21 13:20:00 claudio Exp $ */
/*
* Copyright (c) 2013, 2016 Renato Westphal <renato@openbsd.org>
@@ -586,7 +586,7 @@ evbuf_enqueue(struct evbuf *eb, struct ibuf *buf)
void
evbuf_event_add(struct evbuf *eb)
{
- if (eb->wbuf.queued)
+ if (msgbuf_queuelen(&eb->wbuf) > 0)
event_add(&eb->ev, NULL);
}
diff --git a/usr.sbin/ldpd/packet.c b/usr.sbin/ldpd/packet.c
index ddf3db38fba..f0f8080333c 100644
--- a/usr.sbin/ldpd/packet.c
+++ b/usr.sbin/ldpd/packet.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.73 2024/11/21 13:12:11 claudio Exp $ */
+/* $OpenBSD: packet.c,v 1.74 2024/11/21 13:20:00 claudio Exp $ */
/*
* Copyright (c) 2013, 2016 Renato Westphal <renato@openbsd.org>
@@ -602,7 +602,7 @@ session_write(int fd, short event, void *arg)
if (nbr)
nbr_fsm(nbr, NBR_EVT_CLOSE_SESSION);
- if (nbr == NULL && !tcp->wbuf.wbuf.queued) {
+ if (nbr == NULL && msgbuf_queuelen(&tcp->wbuf.wbuf) == 0) {
/*
* We are done sending the notification message, now we can
* close the socket.