mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-02-21 09:51:50 +00:00
Log error reason if we fail to detect interface type from reading /sys/net
This commit is contained in:
parent
577fbb34db
commit
bb7d95ccd1
@ -1121,6 +1121,7 @@ overlay_interface_register(const char *name,
|
||||
// This interface has a symlink to a physical wifi device
|
||||
detected_type = OVERLAY_INTERFACE_WIFI;
|
||||
}else{
|
||||
WARNF_perror("stat(%s)", path);
|
||||
strbuf_reset(sb);
|
||||
strbuf_sprintf(sb, "/sys/class/net/%s/speed", name);
|
||||
int fd = open(path, O_RDONLY);
|
||||
@ -1129,6 +1130,8 @@ overlay_interface_register(const char *name,
|
||||
// we *could* read this file to set config based on link speed
|
||||
detected_type = OVERLAY_INTERFACE_ETHERNET;
|
||||
close(fd);
|
||||
}else{
|
||||
WARNF_perror("open(%s)", path);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user