summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2010-03-26 16:02:18 +0000
committerclaudio <claudio@openbsd.org>2010-03-26 16:02:18 +0000
commit228e5eea50914a271afee4deb76dd64a48f27318 (patch)
tree4e3505db1aec2726c7175be7f0cb4bccf5b2a6a1
parentevent_del() the read event when hitting a read error or when closing the (diff)
downloadwireguard-openbsd-228e5eea50914a271afee4deb76dd64a48f27318.tar.xz
wireguard-openbsd-228e5eea50914a271afee4deb76dd64a48f27318.zip
Never call close(nbr->fd) when the neighbor session was fully established,
call session_close(nbr) instead since only that will do all needed cleanup. Still not prefect but at least the lde is no longer eating all CPU when a session times out. OK michele@
-rw-r--r--usr.sbin/ldpd/neighbor.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/ldpd/neighbor.c b/usr.sbin/ldpd/neighbor.c
index 1c20eb22fdb..7ec10c85ba1 100644
--- a/usr.sbin/ldpd/neighbor.c
+++ b/usr.sbin/ldpd/neighbor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: neighbor.c,v 1.11 2010/02/25 17:40:46 claudio Exp $ */
+/* $OpenBSD: neighbor.c,v 1.12 2010/03/26 16:02:18 claudio Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -455,7 +455,8 @@ nbr_ktimeout(int fd, short event, void *arg)
nbr->peerid);
send_notification_nbr(nbr, S_KEEPALIVE_TMR, 0, 0);
- close(nbr->fd);
+ /* XXX race, send_notification_nbr() has no chance to be sent */
+ session_close(nbr);
}
void