From 2f5c606669923cff70d3a8cc88180a433328dc49 Mon Sep 17 00:00:00 2001
From: Mats Erik Andersson <gnu@gisladisker.se>
Date: Sat, 11 Jan 2020 23:17:15 +0100
Subject: [PATCH 30/60] Change header inclusion for ifconfig on GNU/Linux.

Conform to manual page recipe for ether_hostton(), attempting
to succeed on systems with musl libc.  Reported by Bruno Haible.
---
 ChangeLog               | 10 ++++++++++
 ifconfig/system/linux.c |  4 +++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 5defbf12..2d4e603a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2020-01-11  Mats Erik Andersson  <gnu@gisladisker.se>
+
+	The glibc manual page for ether address specifies <netinet/ether.h>.
+	Use this for GNU/Linux in the hope of resolving also musl libc, as
+	used with Alpine Linux.  Reported by Bruno Haible.
+
+	* ifconfig/system/linux.c [HAVE_NETINET_ETHER_H]: Include the
+	library header <netinet/ether.h> instead of the system specific
+	header <linux/if_ether.h>.
+
 2020-01-01  Simon Josefsson  <simon@josefsson.org>
 
 	telnet: Validate supplied environment variables. CVE-2019-0053
diff --git a/ifconfig/system/linux.c b/ifconfig/system/linux.c
index cad35442..fd52658c 100644
--- a/ifconfig/system/linux.c
+++ b/ifconfig/system/linux.c
@@ -42,7 +42,9 @@
 #include <sys/ioctl.h>
 #include <net/if.h>
 #include <net/if_arp.h>
-#include <linux/if_ether.h>
+#ifdef HAVE_NETINET_ETHER_H
+# include <netinet/ether.h>
+#endif
 
 #include <read-file.h>
 #include <unused-parameter.h>
-- 
2.26.0.292.g33ef6b2f38

