summaryrefslogtreecommitdiff
path: root/usr.sbin/ospfd
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2006-11-28 19:21:17 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2006-11-28 19:21:17 +0000
commit42dc4672e2746e5183c5a29733c654f4a9644cce (patch)
treedf76318348d55acb95fe86483447a0ed376640df /usr.sbin/ospfd
parent0e1919712e2589382b2029732a09c5ce9488a2cb (diff)
add additional link states to report the half duplex / full duplex
state, if known by the driver. this is required to check the full duplex state without depending on the ifmedia ioctl which can't be called in the kernel without process context. ok henning@, brad@
Diffstat (limited to 'usr.sbin/ospfd')
-rw-r--r--usr.sbin/ospfd/interface.c4
-rw-r--r--usr.sbin/ospfd/kroute.c6
-rw-r--r--usr.sbin/ospfd/ospfe.c6
3 files changed, 8 insertions, 8 deletions
diff --git a/usr.sbin/ospfd/interface.c b/usr.sbin/ospfd/interface.c
index f2e952e137a..30662c5164d 100644
--- a/usr.sbin/ospfd/interface.c
+++ b/usr.sbin/ospfd/interface.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: interface.c,v 1.54 2006/11/17 08:55:31 claudio Exp $ */
+/* $OpenBSD: interface.c,v 1.55 2006/11/28 19:21:15 reyk Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -301,7 +301,7 @@ if_act_start(struct iface *iface)
struct timeval now;
if (!((iface->flags & IFF_UP) &&
- (iface->linkstate == LINK_STATE_UP ||
+ (LINK_STATE_IS_UP(iface->linkstate) ||
(iface->linkstate == LINK_STATE_UNKNOWN &&
iface->media_type != IFT_CARP)))) {
log_debug("if_act_start: interface %s link down",
diff --git a/usr.sbin/ospfd/kroute.c b/usr.sbin/ospfd/kroute.c
index cb74def38fc..ee0ae0d9a9d 100644
--- a/usr.sbin/ospfd/kroute.c
+++ b/usr.sbin/ospfd/kroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kroute.c,v 1.36 2006/11/28 16:36:58 henning Exp $ */
+/* $OpenBSD: kroute.c,v 1.37 2006/11/28 19:21:15 reyk Exp $ */
/*
* Copyright (c) 2004 Esben Norby <norby@openbsd.org>
@@ -674,7 +674,7 @@ if_change(u_short ifindex, int flags, struct if_data *ifd)
kif->k.baudrate = ifd->ifi_baudrate;
if ((reachable = (flags & IFF_UP) &&
- (ifd->ifi_link_state == LINK_STATE_UP ||
+ (LINK_STATE_IS_UP(ifd->ifi_link_state) ||
(ifd->ifi_link_state == LINK_STATE_UNKNOWN &&
ifd->ifi_type != IFT_CARP))) == kif->k.nh_reachable)
return; /* nothing changed wrt nexthop validity */
@@ -967,7 +967,7 @@ fetchifs(int ifindex)
kif->k.baudrate = ifm->ifm_data.ifi_baudrate;
kif->k.mtu = ifm->ifm_data.ifi_mtu;
kif->k.nh_reachable = (kif->k.flags & IFF_UP) &&
- (ifm->ifm_data.ifi_link_state == LINK_STATE_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));
diff --git a/usr.sbin/ospfd/ospfe.c b/usr.sbin/ospfd/ospfe.c
index 471ccf60870..0059741af55 100644
--- a/usr.sbin/ospfd/ospfe.c
+++ b/usr.sbin/ospfd/ospfe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ospfe.c,v 1.49 2006/11/17 08:55:31 claudio Exp $ */
+/* $OpenBSD: ospfe.c,v 1.50 2006/11/28 19:21:15 reyk Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -280,7 +280,7 @@ ospfe_dispatch_main(int fd, short event, void *bula)
fatalx("IFINFO imsg with wrong len");
kif = imsg.data;
link_ok = (kif->flags & IFF_UP) &&
- (kif->link_state == LINK_STATE_UP ||
+ (LINK_STATE_IS_UP(kif->link_state) ||
(kif->link_state == LINK_STATE_UNKNOWN &&
kif->media_type != IFT_CARP));
@@ -735,7 +735,7 @@ orig_rtr_lsa(struct area *area)
if ((iface->flags & IFF_UP) == 0 ||
iface->linkstate == LINK_STATE_DOWN ||
- (iface->linkstate != LINK_STATE_UP &&
+ (!LINK_STATE_IS_UP(iface->linkstate) &&
iface->media_type == IFT_CARP))
continue;