summaryrefslogtreecommitdiff
path: root/usr.sbin/ldpd
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2010-03-26 16:00:10 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2010-03-26 16:00:10 +0000
commit8a39ba3d43d7678c5f5a93a5a942d2a2b7bd32c6 (patch)
treecd95ba6c6912f95cd11df9fd295a740350d74307 /usr.sbin/ldpd
parent8efffd9e11c930b21529122c110490b4aedfe3f9 (diff)
event_del() the read event when hitting a read error or when closing the
file descriptor. If not done, we will loop forever on this event. OK michele@
Diffstat (limited to 'usr.sbin/ldpd')
-rw-r--r--usr.sbin/ldpd/packet.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/ldpd/packet.c b/usr.sbin/ldpd/packet.c
index 5b8b8bf260d..7e7e1d46149 100644
--- a/usr.sbin/ldpd/packet.c
+++ b/usr.sbin/ldpd/packet.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.4 2010/02/25 17:40:46 claudio Exp $ */
+/* $OpenBSD: packet.c,v 1.5 2010/03/26 16:00:09 claudio Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -328,6 +328,7 @@ session_read(int fd, short event, void *arg)
sizeof(nbr->rbuf->buf) - nbr->rbuf->wpos)) == -1) {
if (errno != EINTR && errno != EAGAIN) {
/* XXX find better error */
+ event_del(&nbr->rev);
session_shutdown(nbr, S_SHUTDOWN, 0, 0);
return;
}
@@ -464,6 +465,7 @@ session_close(struct nbr *nbr)
inet_ntoa(nbr->id));
evbuf_clear(&nbr->wbuf);
+ event_del(&nbr->rev);
if (evtimer_pending(&nbr->keepalive_timer, NULL))
evtimer_del(&nbr->keepalive_timer);