diff options
| author | Warner Losh <imp@FreeBSD.org> | 2005-10-04 22:22:51 +0000 |
|---|---|---|
| committer | Warner Losh <imp@FreeBSD.org> | 2005-10-04 22:22:51 +0000 |
| commit | 09c47e76fbc9b60185b1e257cdbed6f31f94b6cf (patch) | |
| tree | 4d730e1fb95a07449b4b23065d793d73161c52a0 /sbin/devd | |
| parent | 9dbcd4b0c0139bb955d4e6055fa915c2b9dbd3b2 (diff) | |
Notes
Diffstat (limited to 'sbin/devd')
| -rw-r--r-- | sbin/devd/devd.cc | 10 |
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); |
