summaryrefslogtreecommitdiff
path: root/sbin/devd
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2005-10-06 23:12:05 +0000
committerWarner Losh <imp@FreeBSD.org>2005-10-06 23:12:05 +0000
commit35900aaad4f098d688f1fb412319652c796f1f93 (patch)
tree316ece80fcee24474981ca20472318a7765ca48c /sbin/devd
parent5a7f1b24f7cf203274c8e311aec4ae79c35cb54e (diff)
Notes
Diffstat (limited to 'sbin/devd')
-rw-r--r--sbin/devd/devd.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/sbin/devd/devd.cc b/sbin/devd/devd.cc
index ad3ef4389505..c5d009f6e7f3 100644
--- a/sbin/devd/devd.cc
+++ b/sbin/devd/devd.cc
@@ -221,11 +221,19 @@ media::~media()
bool
media::do_match(config &c)
{
- string value = c.get_variable("device-name");
+ string value;
struct ifmediareq ifmr;
bool retval;
int s;
+ // Since we can be called from both a device attach/detach
+ // context where device-name is defined and what we want,
+ // as well as from a link status context, where subsystem is
+ // the name of interest, first try device-name and fall back
+ // to subsystem if none exists.
+ value = c.get_variable("device-name");
+ if (value.length() == 0)
+ string value = c.get_variable("subsystem");
if (Dflag)
fprintf(stderr, "Testing media type of %s against 0x%x\n",
value.c_str(), _type);