summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsthen <sthen@openbsd.org>2010-05-14 08:30:18 +0000
committersthen <sthen@openbsd.org>2010-05-14 08:30:18 +0000
commite79881fa50b5d9c4c4a352eb6340a70c9f177acc (patch)
tree52d6df09266c0d6bc01299b72eeead9fbbad386f
parentspacing (diff)
downloadwireguard-openbsd-e79881fa50b5d9c4c4a352eb6340a70c9f177acc.tar.xz
wireguard-openbsd-e79881fa50b5d9c4c4a352eb6340a70c9f177acc.zip
When merging interfaces after a config reload, the fsm state for interfaces
is forced into IF_STA_NEW so that if_init() can be called to setup timers etc. When a loopback interface is added to the config, this means there's no way to get to the correct state. Fix by avoiding changing an existing IF_STA_LOOPBACK and forcing loopback interfaces to be passive (otherwise skipping the if_init on an active interface causes problems). ok claudio@
-rw-r--r--usr.sbin/ospfd/interface.c3
-rw-r--r--usr.sbin/ospfd/ospfd.c5
2 files changed, 5 insertions, 3 deletions
diff --git a/usr.sbin/ospfd/interface.c b/usr.sbin/ospfd/interface.c
index 9ffdadbc24f..f07ff16bff5 100644
--- a/usr.sbin/ospfd/interface.c
+++ b/usr.sbin/ospfd/interface.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: interface.c,v 1.68 2010/02/16 18:20:37 claudio Exp $ */
+/* $OpenBSD: interface.c,v 1.69 2010/05/14 08:30:18 sthen Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -190,6 +190,7 @@ if_new(struct kif *kif, struct kif_addr *ka)
if (kif->flags & IFF_LOOPBACK) {
iface->type = IF_TYPE_POINTOPOINT;
iface->state = IF_STA_LOOPBACK;
+ iface->passive = 1;
}
/* get mtu, index and flags */
diff --git a/usr.sbin/ospfd/ospfd.c b/usr.sbin/ospfd/ospfd.c
index 3d28bc1b39b..679022223d7 100644
--- a/usr.sbin/ospfd/ospfd.c
+++ b/usr.sbin/ospfd/ospfd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ospfd.c,v 1.73 2010/02/19 10:35:52 dlg Exp $ */
+/* $OpenBSD: ospfd.c,v 1.74 2010/05/14 08:30:18 sthen Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -831,7 +831,8 @@ merge_interfaces(struct area *a, struct area *xa)
LIST_REMOVE(xi, entry);
LIST_INSERT_HEAD(&a->iface_list, xi, entry);
xi->area = a;
- if (ospfd_process == PROC_OSPF_ENGINE)
+ if (ospfd_process == PROC_OSPF_ENGINE &&
+ !(xi->state == IF_STA_LOOPBACK))
xi->state = IF_STA_NEW;
continue;
}