summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ripd/kroute.c
diff options
context:
space:
mode:
authorreyk <reyk@openbsd.org>2006-11-28 19:21:15 +0000
committerreyk <reyk@openbsd.org>2006-11-28 19:21:15 +0000
commit307627386806be0bc5eb7752d727b7ee499ed0a7 (patch)
tree9f8c64c381831baefec1b2e0e88a0893c9706702 /usr.sbin/ripd/kroute.c
parentSupport "trace /p <pid>" to show the stack trace of any process. (diff)
downloadwireguard-openbsd-307627386806be0bc5eb7752d727b7ee499ed0a7.tar.xz
wireguard-openbsd-307627386806be0bc5eb7752d727b7ee499ed0a7.zip
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/ripd/kroute.c')
-rw-r--r--usr.sbin/ripd/kroute.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/ripd/kroute.c b/usr.sbin/ripd/kroute.c
index f333186697c..a67848b4c22 100644
--- a/usr.sbin/ripd/kroute.c
+++ b/usr.sbin/ripd/kroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kroute.c,v 1.4 2006/11/28 16:36:58 henning Exp $ */
+/* $OpenBSD: kroute.c,v 1.5 2006/11/28 19:21:15 reyk Exp $ */
/*
* Copyright (c) 2004 Esben Norby <norby@openbsd.org>
@@ -649,7 +649,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 */
@@ -942,7 +942,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));
if ((sa = rti_info[RTAX_IFP]) != NULL)