summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2010-04-15 15:39:32 +0000
committerclaudio <claudio@openbsd.org>2010-04-15 15:39:32 +0000
commit77190cfc046866eb33c1e6077ec9259c48bf5a26 (patch)
tree51b8dc130be7edd25306ed06170bfd9881fad6ed
parentsession_shutdown() issues a NBR_EVT_CLOSE_SESSION and therefore a (diff)
downloadwireguard-openbsd-77190cfc046866eb33c1e6077ec9259c48bf5a26.tar.xz
wireguard-openbsd-77190cfc046866eb33c1e6077ec9259c48bf5a26.zip
Cleanup the interface FSM by removing most of the ospfd specific states
that have nothing to do with LDP. OK michele@
-rw-r--r--usr.sbin/ldpd/interface.c12
-rw-r--r--usr.sbin/ldpd/ldpd.h9
-rw-r--r--usr.sbin/ldpd/log.c6
3 files changed, 7 insertions, 20 deletions
diff --git a/usr.sbin/ldpd/interface.c b/usr.sbin/ldpd/interface.c
index 0bb2d90d441..daa1c4dbda3 100644
--- a/usr.sbin/ldpd/interface.c
+++ b/usr.sbin/ldpd/interface.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: interface.c,v 1.3 2010/04/15 15:04:23 claudio Exp $ */
+/* $OpenBSD: interface.c,v 1.4 2010/04/15 15:39:32 claudio Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -52,6 +52,7 @@ struct {
} 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_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},
};
@@ -268,20 +269,13 @@ if_act_start(struct iface *iface)
iface->uptime = now.tv_sec;
switch (iface->type) {
- case IF_TYPE_POINTOPOINT:
- inet_aton(AllRouters, &addr);
- if (if_join_group(iface, &addr))
- return (-1);
- iface->state = IF_STA_POINTTOPOINT;
- break;
case IF_TYPE_VIRTUALLINK:
- iface->state = IF_STA_POINTTOPOINT;
- break;
case IF_TYPE_POINTOMULTIPOINT:
case IF_TYPE_NBMA:
log_debug("if_act_start: type %s not supported, interface %s",
if_type_name(iface->type), iface->name);
return (-1);
+ case IF_TYPE_POINTOPOINT:
case IF_TYPE_BROADCAST:
inet_aton(AllRouters, &addr);
if (if_join_group(iface, &addr))
diff --git a/usr.sbin/ldpd/ldpd.h b/usr.sbin/ldpd/ldpd.h
index 8b7bf5ece01..354e6bc8a80 100644
--- a/usr.sbin/ldpd/ldpd.h
+++ b/usr.sbin/ldpd/ldpd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldpd.h,v 1.12 2010/04/15 15:04:23 claudio Exp $ */
+/* $OpenBSD: ldpd.h,v 1.13 2010/04/15 15:39:32 claudio Exp $ */
/*
* Copyright (c) 2009 Michele Marchetto <michele@openbsd.org>
@@ -115,11 +115,8 @@ enum imsg_type {
#define IF_STA_NEW 0x00 /* dummy state for reload */
#define IF_STA_DOWN 0x01
#define IF_STA_LOOPBACK 0x02
-#define IF_STA_POINTTOPOINT 0x04
-#define IF_STA_DROTHER 0x08
-#define IF_STA_MULTI (IF_STA_DROTHER | IF_STA_BACKUP | IF_STA_DR)
-#define IF_STA_ANY 0x7f
-#define IF_STA_ACTIVE (~IF_STA_DOWN)
+#define IF_STA_ACTIVE 0x04
+#define IF_STA_ANY 0x07
/* interface events */
enum iface_event {
diff --git a/usr.sbin/ldpd/log.c b/usr.sbin/ldpd/log.c
index 98c9c6a05f5..79980e6470e 100644
--- a/usr.sbin/ldpd/log.c
+++ b/usr.sbin/ldpd/log.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: log.c,v 1.2 2009/11/02 20:34:58 claudio Exp $ */
+/* $OpenBSD: log.c,v 1.3 2010/04/15 15:39:32 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -202,10 +202,6 @@ if_state_name(int state)
return ("DOWN");
case IF_STA_LOOPBACK:
return ("LOOP");
- case IF_STA_POINTTOPOINT:
- return ("P2P");
- case IF_STA_DROTHER:
- return ("OTHER");
case IF_STA_ACTIVE:
return ("ACTIVE");
default: