summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/ldpd/interface.c4
-rw-r--r--usr.sbin/ldpd/neighbor.c11
2 files changed, 13 insertions, 2 deletions
diff --git a/usr.sbin/ldpd/interface.c b/usr.sbin/ldpd/interface.c
index 3441b564eee..aea184212f1 100644
--- a/usr.sbin/ldpd/interface.c
+++ b/usr.sbin/ldpd/interface.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: interface.c,v 1.18 2013/06/04 02:28:27 claudio Exp $ */
+/* $OpenBSD: interface.c,v 1.19 2013/06/04 02:39:10 claudio Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -225,6 +225,8 @@ if_start_hello_timer(struct iface *iface)
{
struct timeval tv;
+ send_hello(HELLO_LINK, iface, NULL);
+
timerclear(&tv);
tv.tv_sec = iface->hello_interval;
if (evtimer_add(&iface->hello_timer, &tv) == -1)
diff --git a/usr.sbin/ldpd/neighbor.c b/usr.sbin/ldpd/neighbor.c
index b04628980f2..a9bd0f5d7fd 100644
--- a/usr.sbin/ldpd/neighbor.c
+++ b/usr.sbin/ldpd/neighbor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: neighbor.c,v 1.37 2013/06/04 02:34:48 claudio Exp $ */
+/* $OpenBSD: neighbor.c,v 1.38 2013/06/04 02:39:10 claudio Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -466,6 +466,7 @@ nbr_establish_connection(struct nbr *nbr)
{
struct sockaddr_in local_sa;
struct sockaddr_in remote_sa;
+ struct adj *adj;
nbr->fd = socket(AF_INET, SOCK_STREAM, 0);
if (nbr->fd == -1) {
@@ -494,6 +495,14 @@ nbr_establish_connection(struct nbr *nbr)
remote_sa.sin_port = htons(LDP_PORT);
remote_sa.sin_addr.s_addr = nbr->addr.s_addr;
+ /*
+ * Send an extra hello to guarantee that the remote peer has formed
+ * an adjacency as well.
+ */
+ LIST_FOREACH(adj, &nbr->adj_list, nbr_entry)
+ send_hello(adj->source.type, adj->source.link.iface,
+ adj->source.target);
+
if (connect(nbr->fd, (struct sockaddr *)&remote_sa,
sizeof(remote_sa)) == -1) {
if (errno == EINPROGRESS) {