diff mbox series

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

Message ID 65a04a86.49eda6.3044c037@gateway.sonic.net
State New
Headers show
Series None | expand

Commit Message

Nick Briggs Jan. 11, 2024, 7:43 p.m. UTC
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.

Signed-off-by: Nick Briggs <nicholas.h.briggs@gmail.com>
---
 qga/commands-posix.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Konstantin Kostiuk Jan. 17, 2024, 5:12 p.m. UTC | #1
Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com>

On Thu, Jan 11, 2024 at 10:18 PM Nick Briggs <nicholas.h.briggs@gmail.com>
wrote:

> 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.
>
> Signed-off-by: Nick Briggs <nicholas.h.briggs@gmail.com>
> ---
>  qga/commands-posix.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/qga/commands-posix.c b/qga/commands-posix.c
> index 6169bbf7a0..26008db497 100644
> --- a/qga/commands-posix.c
> +++ b/qga/commands-posix.c
> @@ -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
>
>
diff mbox series

Patch

diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index 6169bbf7a0..26008db497 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -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