commit-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Inetutils branch, master, updated. inetutils-1_9_4-8-g25b4f34


From: Mats Erik Andersson
Subject: [SCM] GNU Inetutils branch, master, updated. inetutils-1_9_4-8-g25b4f34
Date: Wed, 29 Jul 2015 23:11:26 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Inetutils ".

The branch, master has been updated
       via  25b4f3449c040c79ae459cd9a3d0e6984eaa272c (commit)
      from  a7be57c41320dab107f0368d7af17fed91b682f8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=25b4f3449c040c79ae459cd9a3d0e6984eaa272c


commit 25b4f3449c040c79ae459cd9a3d0e6984eaa272c
Author: Mats Erik Andersson <address@hidden>
Date:   Thu Jul 30 01:06:42 2015 +0200

    ifconfig: Hardware detection in GNU/Hurd.
    
    A work-around needed to distinguish hardware type.

diff --git a/ChangeLog b/ChangeLog
index d1f4c47..f35be24 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2015-07-30  Mats Erik Andersson  <address@hidden>
+
+       ifconfig: A work-around specific to GNU/Hurd.
+       This system uses a mixture of BSD definitions
+       and GNU/Linux interfaces.  In particular, some
+       care is needed to check interface hardware type.
+
+       * ifconfig/system/hurd.c (_ARP_MASK): New macro.
+       (arphrd_symbols): Apply _ARP_MASK to each member `value'.
+
 2015-07-25  Mats Erik Andersson  <address@hidden>
 
        ifconfig: Symbolic name as peer address.
diff --git a/ifconfig/system/hurd.c b/ifconfig/system/hurd.c
index 3bd1977..b6261a0 100644
--- a/ifconfig/system/hurd.c
+++ b/ifconfig/system/hurd.c
@@ -175,6 +175,16 @@ print_hwaddr_ether (format_data_t form 
_GL_UNUSED_PARAMETER,
   had_output = 1;
 }
 
+/* GNU/Hurd and Mach are using a mixture of BSD definitions
+ * and GNU/Linux interface headers, which in this situation
+ * means that sa_family_t is an unsigned char, from BSD, while
+ * all ARPHRD_* come from GNU/Linux and are thus 16 bits wide.
+ * We must account for this.  The following bitmask will
+ * adapt to any future change!
+ */
+
+#define _ARP_MASK ((sizeof (sa_family_t) == 1) ? 0xff : 0xffff)
+
 struct arphrd_symbol
 {
   const char *name;
@@ -184,16 +194,11 @@ struct arphrd_symbol
 } arphrd_symbols[] =
   {
 #ifdef ARPHRD_ETHER            /* Ethernet 10/100Mbps.  */
-    { "ETHER", "Ethernet", ARPHRD_ETHER, print_hwaddr_ether},
+    { "ETHER", "Ethernet", ARPHRD_ETHER & _ARP_MASK, print_hwaddr_ether},
 #endif
 #ifdef ARPHRD_LOOPBACK         /* Loopback device.  */
-    { "LOOPBACK", "Local Loopback", ARPHRD_LOOPBACK, NULL},
+    { "LOOPBACK", "Local Loopback", ARPHRD_LOOPBACK & _ARP_MASK, NULL},
 #endif
-    /* XXX: The image debian-hurd-20150424 returns the value 4
-           instead of expected ARPHRD_LOOPBACK.  This has been
-           discussed in the list debian-hurd, where I was asked
-           to resist the temptation of a work around!
-     */
     { NULL, NULL, 0, NULL}
   };
 

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog              |   10 ++++++++++
 ifconfig/system/hurd.c |   19 ++++++++++++-------
 2 files changed, 22 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]