summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2011-05-06 13:48:47 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2011-05-06 13:48:47 +0000
commit578598d56ab7fb575c7c52d13c7336145cf49d17 (patch)
tree825df42797620924b36844023893e48efab9baf9 /usr.sbin
parentbd1d74f19431bac78cf620840e6bf4893a44a578 (diff)
Do not special case loopback interfaces on init. Instead force them
to IF_STA_LOOPBACK in if_act_start() this way they will repsect IFF_UP on startup. Also mark the interfaces as passive. Initial diff provided by Patrick Coleman. OK dlg@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ospf6d/interface.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/usr.sbin/ospf6d/interface.c b/usr.sbin/ospf6d/interface.c
index 83d95c57e0d..0d085a15288 100644
--- a/usr.sbin/ospf6d/interface.c
+++ b/usr.sbin/ospf6d/interface.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: interface.c,v 1.15 2009/09/20 20:45:06 stsp Exp $ */
+/* $OpenBSD: interface.c,v 1.16 2011/05/06 13:48:46 claudio Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -250,7 +250,7 @@ if_update(struct iface *iface, int mtu, int flags, u_int8_t type,
iface->type = IF_TYPE_BROADCAST;
if (flags & IFF_LOOPBACK) {
iface->type = IF_TYPE_POINTOPOINT;
- iface->state = IF_STA_LOOPBACK;
+ iface->cflags |= F_IFACE_PASSIVE;
}
}
@@ -386,15 +386,19 @@ if_act_start(struct iface *iface)
iface->cflags |= F_IFACE_PASSIVE;
}
+ gettimeofday(&now, NULL);
+ iface->uptime = now.tv_sec;
+
+ /* loopback interfaces have a special state */
+ if (iface->flags & IFF_LOOPBACK)
+ iface->state = IF_STA_LOOPBACK;
+
if (iface->cflags & F_IFACE_PASSIVE) {
/* for an update of stub network entries */
orig_rtr_lsa(iface);
return (0);
}
- gettimeofday(&now, NULL);
- iface->uptime = now.tv_sec;
-
switch (iface->type) {
case IF_TYPE_POINTOPOINT:
inet_pton(AF_INET6, AllSPFRouters, &addr);