summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2013-05-30 16:22:53 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2013-05-30 16:22:53 +0000
commit3715d6ffc902bd0c3dbb29632eb8cbd7cd86605e (patch)
tree50bf8204a6cfe925c7ca36f0c14c79236c6e035d
parenta819df68ff71df722e3e71663cc9127700470a03 (diff)
Fix bug when starting ldpd with a configured interface in the down state.
If a given interface is down at startup, don't promote it to the ACTIVE state. Diff from Renato Westphal [renatowestphal at gmail.com]
-rw-r--r--usr.sbin/ldpd/interface.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/ldpd/interface.c b/usr.sbin/ldpd/interface.c
index 691cb42f388..582197772fb 100644
--- a/usr.sbin/ldpd/interface.c
+++ b/usr.sbin/ldpd/interface.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: interface.c,v 1.10 2013/05/30 16:19:31 claudio Exp $ */
+/* $OpenBSD: interface.c,v 1.11 2013/05/30 16:22:52 claudio Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -51,7 +51,7 @@ struct {
int new_state;
} iface_fsm[] = {
/* current state event that happened action to take resulting state */
- {IF_STA_DOWN, IF_EVT_UP, IF_ACT_STRT, IF_STA_ACTIVE},
+ {IF_STA_DOWN, IF_EVT_UP, IF_ACT_STRT, 0},
{IF_STA_LOOPBACK, IF_EVT_DOWN, IF_ACT_NOTHING, IF_STA_DOWN},
{IF_STA_ANY, IF_EVT_DOWN, IF_ACT_RST, IF_STA_DOWN},
{-1, IF_EVT_NOTHING, IF_ACT_NOTHING, 0},
@@ -248,7 +248,7 @@ if_act_start(struct iface *iface)
inet_aton(AllRouters, &addr);
if (if_join_group(iface, &addr))
return (-1);
- iface->state = IF_STA_DOWN;
+ iface->state = IF_STA_ACTIVE;
/* hello timer needs to be started in any case */
if_start_hello_timer(iface);