summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2004-05-10 21:32:00 +0000
committerLennart Poettering <lennart@poettering.net>2004-05-10 21:32:00 +0000
commit65c009df1c2b3432cb3686a6a3941965fabcbbfd (patch)
tree1601be05c8a95a26a00e039a7a92996cad34f40f
parent3a46885c17ba051ced802e3d35b9ddc6bf10edf6 (diff)
preliminary work for ifplugd 0.25
git-svn-id: file:///home/lennart/svn/public/ifplugd/trunk@110 2bf48fe7-cfc1-0310-909f-d9042e1e0fef
-rw-r--r--configure.ac2
-rw-r--r--doc/README.html.in9
-rw-r--r--man/ifplugstatus.8.xml.in11
-rw-r--r--src/ifplugd.c12
-rw-r--r--src/ifplugstatus.c21
5 files changed, 28 insertions, 27 deletions
diff --git a/configure.ac b/configure.ac
index c803c43..e435477 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,7 +20,7 @@
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
AC_PREREQ(2.59)
-AC_INIT([ifplugd],[0.24],[mzvscyhtq (at) 0pointer (dot) de])
+AC_INIT([ifplugd],[0.25],[mzvscyhtq (at) 0pointer (dot) de])
AC_CONFIG_SRCDIR([src/ifplugd.c])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([foreign -Wall])
diff --git a/doc/README.html.in b/doc/README.html.in
index d0ceace..ae833b5 100644
--- a/doc/README.html.in
+++ b/doc/README.html.in
@@ -42,6 +42,13 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.</p>
<h2><a name="news">News</a></h2>
+<div class="news-date">Mon May 10 2004: </div> <p class="news-text"><a
+href="@PACKAGE_URL@ifplugd-0.25.tar.gz">Version 0.25</a> released,
+changes include: Revert to more classic link checking support. The new
+checking order is: ETHTOOL, MII, WLAN, IFF. The obsolete API "PRIV" is
+no longer checked by the automatic API detection code. However, you may enable
+it forcibly by passing <tt>-w priv</tt> on the command line.</p>
+
<div class="news-date">Mon Apr 12 2004: </div> <p class="news-text"><a
href="@PACKAGE_URL@ifplugd-0.24.tar.gz">Version
0.24</a> released, changes include: add <tt>IFF_RUNNING</tt> link check support and make it the default. This might break some setups. You may workaround this by passing <tt>-m</tt> to the daemon for selecting a different API. Please report breakages!</p>
@@ -324,7 +331,7 @@ manpage</p>
<p><b>New!</b> There is a joint <tt>ifplugd</tt> and <tt>waproamd</tt> <a href="https://seth.intheinter.net/mailman/listinfo/ifplugd-discuss">mailing list</a> available.</p>
<hr/>
-<address class="grey">Lennart Poettering &lt;@PACKAGE_BUGREPORT@&gt;, April 2004</address>
+<address class="grey">Lennart Poettering &lt;@PACKAGE_BUGREPORT@&gt;, May 2004</address>
<div class="grey"><i>$Id$</i></div>
</body>
diff --git a/man/ifplugstatus.8.xml.in b/man/ifplugstatus.8.xml.in
index 684ba02..755d64c 100644
--- a/man/ifplugstatus.8.xml.in
+++ b/man/ifplugstatus.8.xml.in
@@ -39,13 +39,14 @@
<p>The APIs are tried in the following order:</p>
- <p>First the cleanest API: <arg>IFF_RUNNING</arg> (aka ifconfig API)</p>
- <p>Second the newest API: <arg>SIOCETHTOOL</arg> (aka ethtool API)</p>
- <p>Third the next older API: <arg>SIOCGMIIREG</arg> (aka mii-diag API)</p>
+ <p>First the newest API: <arg>SIOCETHTOOL</arg> (aka ethtool API)</p>
+ <p>Second the next older API: <arg>SIOCGMIIREG</arg> (aka mii-diag API)</p>
<p>Than the WLAN API: <arg>wireless extension</arg> (aka iwconfig API)</p>
- <p>Finally the oldest API: <arg>SIOCPRIV</arg> (aka mii-tool API)</p>
+ <p>Followed by the cleanest API: <arg>IFF_RUNNING</arg> (aka ifconfig API)</p>
- <p>It may be used in shell script since it returns the
+ <p>The oldest API (<arg>SIOCPRIV</arg> aka mii-tool API) is not tested since it is obsolete.</p>
+
+ <p>ifplugstatus may be used in shell script since it returns the
current status as return value. It is especially useful to
detect the available APIs on the used network driver. (Option
<opt>-v</opt>)</p>
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: