summaryrefslogtreecommitdiff
path: root/hscript/network.cc
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-14 09:21:22 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-10-14 09:21:22 -0500
commitaec0842632ea32fec9939c221fb5554d1900a3a5 (patch)
tree440e3e59d392e684397f14d1f9bc6ca47d159df9 /hscript/network.cc
parente23831df4386ebccd89e768f543533e3364b5333 (diff)
downloadhorizon-aec0842632ea32fec9939c221fb5554d1900a3a5.tar.gz
horizon-aec0842632ea32fec9939c221fb5554d1900a3a5.tar.bz2
horizon-aec0842632ea32fec9939c221fb5554d1900a3a5.tar.xz
horizon-aec0842632ea32fec9939c221fb5554d1900a3a5.zip
hscript: A few changes [read full message]
* Handle ENODEV as well as EOPNOTSUPP in NetSSID::validate. Whether iface is not wifi or doesn't exist, same result per spec. * *Failures* are fatal, but *ENODEV/EOPNOTSUPP* is not a failure. So, repair logic in Script::validate and return proper value.
Diffstat (limited to 'hscript/network.cc')
-rw-r--r--hscript/network.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/hscript/network.cc b/hscript/network.cc
index e02e5df..c8f42de 100644
--- a/hscript/network.cc
+++ b/hscript/network.cc
@@ -324,11 +324,17 @@ bool NetSSID::validate(ScriptOptions options) const {
this->_iface.size());
errno = 0;
if(ioctl(my_sock, SIOCGIWNAME, &request) == -1) {
- if(errno == EOPNOTSUPP) {
+ switch(errno)
+ {
+ case EOPNOTSUPP:
output_warning("installfile:" + std::to_string(this->lineno()),
"netssid: interface specified is not wireless");
- return false;
- } else {
+ return true;
+ case ENODEV:
+ output_warning("installfile:" + std::to_string(this->lineno()),
+ "netssid: specified interface does not exist");
+ return true;
+ default:
output_error("installfile:" + std::to_string(this->lineno()),
"netssid: error communicating with wireless device");
return false;