diff options
author | Reyk Floeter <reyk@cvs.openbsd.org> | 2006-11-28 19:21:17 +0000 |
---|---|---|
committer | Reyk Floeter <reyk@cvs.openbsd.org> | 2006-11-28 19:21:17 +0000 |
commit | 42dc4672e2746e5183c5a29733c654f4a9644cce (patch) | |
tree | df76318348d55acb95fe86483447a0ed376640df /usr.sbin/ripd | |
parent | 0e1919712e2589382b2029732a09c5ce9488a2cb (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/ripd')
-rw-r--r-- | usr.sbin/ripd/interface.c | 4 | ||||
-rw-r--r-- | usr.sbin/ripd/kroute.c | 6 | ||||
-rw-r--r-- | usr.sbin/ripd/ripe.c | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/usr.sbin/ripd/interface.c b/usr.sbin/ripd/interface.c index be9917361ad..f5ecc524102 100644 --- a/usr.sbin/ripd/interface.c +++ b/usr.sbin/ripd/interface.c @@ -1,4 +1,4 @@ -/* $OpenBSD: interface.c,v 1.1 2006/10/18 16:11:58 norby Exp $ */ +/* $OpenBSD: interface.c,v 1.2 2006/11/28 19:21:15 reyk Exp $ */ /* * Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it> @@ -159,7 +159,7 @@ if_act_start(struct iface *iface) } 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/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) diff --git a/usr.sbin/ripd/ripe.c b/usr.sbin/ripd/ripe.c index 1d760bb263a..4abbb4040c2 100644 --- a/usr.sbin/ripd/ripe.c +++ b/usr.sbin/ripd/ripe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ripe.c,v 1.3 2006/10/31 23:43:11 michele Exp $ */ +/* $OpenBSD: ripe.c,v 1.4 2006/11/28 19:21:16 reyk Exp $ */ /* * Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it> @@ -250,7 +250,7 @@ ripe_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)); |