summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ifplugd.c12
-rw-r--r--src/ifplugstatus.c21
2 files changed, 13 insertions, 20 deletions
diff --git a/src/ifplugd.c b/src/ifplugd.c
index d9aa708..624d991 100644
--- a/src/ifplugd.c
+++ b/src/ifplugd.c
@@ -254,12 +254,6 @@ interface_status_t detect_beat_auto(int fd, char *iface) {
if (cached_detect_beat_func && (status = cached_detect_beat_func(fd, iface)) != IFSTATUS_ERR)
return status;
- if ((status = interface_detect_beat_iff(fd, iface)) != IFSTATUS_ERR) {
- cached_detect_beat_func = interface_detect_beat_iff;
- daemon_log(LOG_INFO, "Using detection mode: IFF_RUNNING");
- return status;
- }
-
if ((status = interface_detect_beat_ethtool(fd, iface)) != IFSTATUS_ERR) {
cached_detect_beat_func = interface_detect_beat_ethtool;
daemon_log(LOG_INFO, "Using detection mode: SIOCETHTOOL");
@@ -278,9 +272,9 @@ interface_status_t detect_beat_auto(int fd, char *iface) {
return status;
}
- if ((status = interface_detect_beat_priv(fd, iface)) != IFSTATUS_ERR) {
- cached_detect_beat_func = interface_detect_beat_priv;
- daemon_log(LOG_INFO, "Using detection mode: SIOCDEVPRIVATE");
+ if ((status = interface_detect_beat_iff(fd, iface)) != IFSTATUS_ERR) {
+ cached_detect_beat_func = interface_detect_beat_iff;
+ daemon_log(LOG_INFO, "Using detection mode: IFF_RUNNING");
return status;
}
diff --git a/src/ifplugstatus.c b/src/ifplugstatus.c
index e4db11b..04c59b9 100644
--- a/src/ifplugstatus.c
+++ b/src/ifplugstatus.c
@@ -51,11 +51,6 @@ int handle(char *iface) {
if (verbose > 0) {
printf("%s:\n", iface);
- if ((s = interface_detect_beat_iff(fd, iface)) == IFSTATUS_ERR)
- printf(" IFF_RUNNING failed.\n");
- else
- printf(" IFF_RUNNING: %s\n", s == IFSTATUS_UP ? "link beat detected" : "unplugged");
-
if ((s = interface_detect_beat_ethtool(fd, iface)) == IFSTATUS_ERR)
printf(" SIOCETHTOOL failed (%s)\n", strerror(errno));
else
@@ -71,18 +66,22 @@ int handle(char *iface) {
else
printf(" Wireless: %s\n", s == IFSTATUS_UP ? "link beat detected" : "unplugged");
+ if ((s = interface_detect_beat_iff(fd, iface)) == IFSTATUS_ERR)
+ printf(" IFF_RUNNING failed.\n");
+ else
+ printf(" IFF_RUNNING: %s\n", s == IFSTATUS_UP ? "link beat detected" : "unplugged");
+
if ((s = interface_detect_beat_priv(fd, iface)) == IFSTATUS_ERR)
printf(" SIOCDEVPRIVATE failed (%s)\n", strerror(errno));
else
printf(" SIOCDEVPRIVATE: %s\n", s == IFSTATUS_UP ? "link beat detected" : "unplugged");
} else {
-
- if ((s = interface_detect_beat_iff(fd, iface)) == IFSTATUS_ERR)
- if ((s = interface_detect_beat_ethtool(fd, iface)) == IFSTATUS_ERR)
- if ((s = interface_detect_beat_mii(fd, iface)) == IFSTATUS_ERR)
- if ((s = interface_detect_beat_wlan(fd, iface)) == IFSTATUS_ERR)
- s = interface_detect_beat_priv(fd, iface);
+
+ if ((s = interface_detect_beat_ethtool(fd, iface)) == IFSTATUS_ERR)
+ if ((s = interface_detect_beat_mii(fd, iface)) == IFSTATUS_ERR)
+ if ((s = interface_detect_beat_wlan(fd, iface)) == IFSTATUS_ERR)
+ s = interface_detect_beat_iff(fd, iface);
switch(s) {
case IFSTATUS_UP: