Skip to contentSkip to conversation

qga: Solaris has net/if_arp.h and netinet/if_ether.h but not ETHER_ADDR_LEN

PATCH In review Nick Briggs 2 participants 2 messages Jan 11, 2024 – Jan 17, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 qga: Solaris has net/if_arp.h and netinet/if_ether.h but not ETHER_ADDR_LEN

Solaris has net/if_arp.h and netinet/if_ether.h rather than net/ethernet.h, but does not define ETHER_ADDR_LEN, instead providing ETHERADDRL.

---
 qga/commands-posix.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
qga/commands-posix.c +4 -1
index 6169bbf7a0..26008db497 100644
@@ -45,9 +45,12 @@
 #include <arpa/inet.h>
 #include <sys/socket.h>
 #include <net/if.h>
-#if defined(__NetBSD__) || defined(__OpenBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(CONFIG_SOLARIS)
 #include <net/if_arp.h>
 #include <netinet/if_ether.h>
+#if !defined(ETHER_ADDR_LEN) && defined(ETHERADDRL)
+#define ETHER_ADDR_LEN ETHERADDRL
+#endif
 #else
 #include <net/ethernet.h>
 #endif
Signature · 1 line
2.31.1
Reviewed-by on v1 2/2
#1 lore raw
Quoted 30 lines · Nick Briggs

Solaris has net/if_arp.h and netinet/if_ether.h rather than net/ethernet.h, but does not define ETHER_ADDR_LEN, instead providing ETHERADDRL.

---
 qga/commands-posix.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
qga/commands-posix.c +4 -2
index 6169bbf7a0..26008db497 100644
@@ -45,9 +45,12 @@
 #include <arpa/inet.h>
 #include <sys/socket.h>
 #include <net/if.h>
-#if defined(__NetBSD__) || defined(__OpenBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(CONFIG_SOLARIS)
 #include <net/if_arp.h>
 #include <netinet/if_ether.h>
+#if !defined(ETHER_ADDR_LEN) && defined(ETHERADDRL)
+#define ETHER_ADDR_LEN ETHERADDRL
+#endif
 #else
 #include <net/ethernet.h>
 #endif
--

2.31.1