12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- From 589dab9c7d3119da82837dabae34c8a3d16cbe49 Mon Sep 17 00:00:00 2001
- From: Mats Erik Andersson <gnu@gisladisker.se>
- Date: Thu, 30 Jul 2015 01:06:42 +0200
- Subject: [PATCH 07/60] ifconfig: Hardware detection in GNU/Hurd.
- A work-around needed to distinguish hardware type.
- ---
- ChangeLog | 10 ++++++++++
- ifconfig/system/hurd.c | 19 ++++++++++++-------
- 2 files changed, 22 insertions(+), 7 deletions(-)
- diff --git a/ChangeLog b/ChangeLog
- index 72806b79..2f664b8d 100644
- --- a/ChangeLog
- +++ b/ChangeLog
- @@ -1,3 +1,13 @@
- +2015-07-30 Mats Erik Andersson <gnu@gisladisker.se>
- +
- + 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 <gnu@gisladisker.se>
-
- ifconfig: Symbolic name as peer address.
- diff --git a/ifconfig/system/hurd.c b/ifconfig/system/hurd.c
- index 3bd19775..b6261a00 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}
- };
-
- --
- 2.26.0.292.g33ef6b2f38
|