summaryrefslogtreecommitdiff
path: root/usr.sbin/ospf6d
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2011-07-04 04:34:15 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2011-07-04 04:34:15 +0000
commite03be1c13da2627f88815c4221fd7aea1ef8f515 (patch)
treea68cb661597a54bfac8799839218986aea79977e /usr.sbin/ospf6d
parent6558208a6b4fc7625013eefd861685b315297077 (diff)
LINK_STATE_IS_UP() cleanup userland part. There is no need to special
case carp(4) interfaces anymore. LINK_STATE_IS_UP() almost always does the right job. OK deraadt@ henning@ This needs a -current kernel or link state may be not reported correctly.
Diffstat (limited to 'usr.sbin/ospf6d')
-rw-r--r--usr.sbin/ospf6d/interface.c6
-rw-r--r--usr.sbin/ospf6d/kroute.c11
-rw-r--r--usr.sbin/ospf6d/rde.c6
3 files changed, 7 insertions, 16 deletions
diff --git a/usr.sbin/ospf6d/interface.c b/usr.sbin/ospf6d/interface.c
index 6779b962c65..ad86e2a0fe9 100644
--- a/usr.sbin/ospf6d/interface.c
+++ b/usr.sbin/ospf6d/interface.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: interface.c,v 1.17 2011/07/04 04:08:34 claudio Exp $ */
+/* $OpenBSD: interface.c,v 1.18 2011/07/04 04:34:14 claudio Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -370,9 +370,7 @@ if_act_start(struct iface *iface)
struct timeval now;
if (!((iface->flags & IFF_UP) &&
- (LINK_STATE_IS_UP(iface->linkstate) ||
- (iface->linkstate == LINK_STATE_UNKNOWN &&
- iface->media_type != IFT_CARP)))) {
+ LINK_STATE_IS_UP(iface->linkstate))) {
log_debug("if_act_start: interface %s link down",
iface->name);
return (0);
diff --git a/usr.sbin/ospf6d/kroute.c b/usr.sbin/ospf6d/kroute.c
index 255294557ee..6ea5b4e7181 100644
--- a/usr.sbin/ospf6d/kroute.c
+++ b/usr.sbin/ospf6d/kroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kroute.c,v 1.30 2011/03/07 07:43:02 henning Exp $ */
+/* $OpenBSD: kroute.c,v 1.31 2011/07/04 04:34:14 claudio Exp $ */
/*
* Copyright (c) 2004 Esben Norby <norby@openbsd.org>
@@ -805,9 +805,7 @@ if_change(u_short ifindex, int flags, struct if_data *ifd)
}
reachable = (iface->flags & IFF_UP) &&
- (LINK_STATE_IS_UP(iface->linkstate) ||
- (iface->linkstate == LINK_STATE_UNKNOWN &&
- iface->media_type != IFT_CARP));
+ LINK_STATE_IS_UP(iface->linkstate);
if (reachable == iface->nh_reachable)
return; /* nothing changed wrt nexthop validity */
@@ -1293,10 +1291,7 @@ fetchifs(u_short ifindex)
fatal("fetchifs");
iface->nh_reachable = (iface->flags & IFF_UP) &&
- (LINK_STATE_IS_UP(ifm.ifm_data.ifi_link_state) ||
- (ifm.ifm_data.ifi_link_state ==
- LINK_STATE_UNKNOWN &&
- ifm.ifm_data.ifi_type != IFT_CARP));
+ LINK_STATE_IS_UP(ifm.ifm_data.ifi_link_state);
break;
case RTM_NEWADDR:
ifam = (struct ifa_msghdr *)rtm;
diff --git a/usr.sbin/ospf6d/rde.c b/usr.sbin/ospf6d/rde.c
index fae779a83fa..61306b0b201 100644
--- a/usr.sbin/ospf6d/rde.c
+++ b/usr.sbin/ospf6d/rde.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.c,v 1.53 2011/07/04 04:08:34 claudio Exp $ */
+/* $OpenBSD: rde.c,v 1.54 2011/07/04 04:34:14 claudio Exp $ */
/*
* Copyright (c) 2004, 2005 Claudio Jeker <claudio@openbsd.org>
@@ -1468,9 +1468,7 @@ orig_intra_lsa_rtr(struct area *area, struct vertex *old)
numprefix = 0;
LIST_FOREACH(iface, &area->iface_list, entry) {
if (!((iface->flags & IFF_UP) &&
- (LINK_STATE_IS_UP(iface->linkstate) ||
- (iface->linkstate == LINK_STATE_UNKNOWN &&
- iface->media_type != IFT_CARP))))
+ LINK_STATE_IS_UP(iface->linkstate)))
/* interface or link state down */
continue;
if ((iface->state & IF_STA_DOWN) &&