summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ldpd/hello.c
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2013-05-31 14:10:10 +0000
committerclaudio <claudio@openbsd.org>2013-05-31 14:10:10 +0000
commit1f7e7d7716c8800c1a435c679fc7cea21688ec6b (patch)
treed7a1a0e16ddce947e151364a1d1c775505a8e1a7 /usr.sbin/ldpd/hello.c
parentUse %lld for printing time_t (diff)
downloadwireguard-openbsd-1f7e7d7716c8800c1a435c679fc7cea21688ec6b.tar.xz
wireguard-openbsd-1f7e7d7716c8800c1a435c679fc7cea21688ec6b.zip
When the ldpe process calls connect(), it doesn't regain control until
either the connection is made or an error occurs. The time the process is blocked can be significantly large to the point of other LDP sessions being torn down because of their holdtime. Besides that, the ldpctl program gets unresponsive if the ldpe process is blocked. Fix these issues by using a non-blocking connect. Diff from Renato Westphal [renatowestphal at gmail.com]
Diffstat (limited to 'usr.sbin/ldpd/hello.c')
-rw-r--r--usr.sbin/ldpd/hello.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/ldpd/hello.c b/usr.sbin/ldpd/hello.c
index 3bf9be54bd1..137b6e4f9eb 100644
--- a/usr.sbin/ldpd/hello.c
+++ b/usr.sbin/ldpd/hello.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hello.c,v 1.13 2013/05/30 16:14:50 claudio Exp $ */
+/* $OpenBSD: hello.c,v 1.14 2013/05/31 14:10:10 claudio Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -149,8 +149,9 @@ recv_hello(struct iface *iface, struct in_addr src, char *buf, u_int16_t len)
nbr_fsm(nbr, NBR_EVT_HELLO_RCVD);
if (ntohl(nbr->addr.s_addr) < ntohl(nbr->iface->addr.s_addr) &&
- nbr->state == NBR_STA_PRESENT && !nbr_pending_idtimer(nbr))
- nbr_act_session_establish(nbr, 1);
+ nbr->state == NBR_STA_PRESENT && !nbr_pending_connect(nbr) &&
+ !nbr_pending_idtimer(nbr))
+ nbr_establish_connection(nbr);
}
int