Re: [PATCH] Factorize net/ethernet.h

Samuel Thibault <[email protected]>
Newsgroups gmane.comp.lib.glibc.alpha
Organization I am not organized
Message-ID <alpgHPzRsbRoXgsP@end>
Hello,

I have not seen news on this, is it ok to commit?

With regards,
Samuel

Samuel Thibault, le dim. 28 juin 2026 18:59:58 +0200, a ecrit:
> The Linux version is much more up to date, and is OS-independent.
> 
> This introduces net/if_ether.h which just pulls linux/if_ether.h, like
> many other such compatibility headers.
> ---
>  NEWS                                            | 3 +++
>  sysdeps/gnu/Makefile                            | 2 +-
>  sysdeps/{unix/sysv/linux => gnu}/net/ethernet.h | 2 +-
>  sysdeps/{mach/hurd => gnu}/net/if_ether.h       | 0
>  sysdeps/mach/hurd/Makefile                      | 2 +-
>  sysdeps/unix/sysv/linux/Makefile                | 1 -
>  sysdeps/unix/sysv/linux/net/if_ether.h          | 1 +
>  7 files changed, 7 insertions(+), 4 deletions(-)
>  rename sysdeps/{unix/sysv/linux => gnu}/net/ethernet.h (97%)
>  rename sysdeps/{mach/hurd => gnu}/net/if_ether.h (100%)
>  create mode 100644 sysdeps/unix/sysv/linux/net/if_ether.h
> 
> diff --git a/NEWS b/NEWS
> index f9d90c5194..b7ac8bdf05 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -37,6 +37,9 @@ Major new features:
>    status via prctl syscall.  This prevents disabling or corrupting GCS
>    shadow stack during runtime.
>  
> +* The <net/if_ether.h> header is introduced to provide ethernet header
> +  constants and structure, like on BSD.
> +
>  Deprecated and removed features, and other changes affecting compatibility:
>  
>  * Although malloc and related functions currently return pointers
> diff --git a/sysdeps/gnu/Makefile b/sysdeps/gnu/Makefile
> index 2844d37fa0..fcac64abf3 100644
> --- a/sysdeps/gnu/Makefile
> +++ b/sysdeps/gnu/Makefile
> @@ -82,5 +82,5 @@ sysdep_headers += \
>  endif
>  
>  ifeq ($(subdir),socket)
> -sysdep_headers += net/if_arp.h
> +sysdep_headers += net/ethernet.h net/if_arp.h net/if_ether.h
>  endif
> diff --git a/sysdeps/unix/sysv/linux/net/ethernet.h b/sysdeps/gnu/net/ethernet.h
> similarity index 97%
> rename from sysdeps/unix/sysv/linux/net/ethernet.h
> rename to sysdeps/gnu/net/ethernet.h
> index b468b5b2c4..0f06c1fb24 100644
> --- a/sysdeps/unix/sysv/linux/net/ethernet.h
> +++ b/sysdeps/gnu/net/ethernet.h
> @@ -24,7 +24,7 @@
>  #include <sys/types.h>
>  #include <stdint.h>
>  
> -#include <linux/if_ether.h>     /* IEEE 802.3 Ethernet constants */
> +#include <net/if_ether.h>     /* IEEE 802.3 Ethernet constants */
>  
>  __BEGIN_DECLS
>  
> diff --git a/sysdeps/mach/hurd/net/if_ether.h b/sysdeps/gnu/net/if_ether.h
> similarity index 100%
> rename from sysdeps/mach/hurd/net/if_ether.h
> rename to sysdeps/gnu/net/if_ether.h
> diff --git a/sysdeps/mach/hurd/Makefile b/sysdeps/mach/hurd/Makefile
> index a5027510af..f5885cfea0 100644
> --- a/sysdeps/mach/hurd/Makefile
> +++ b/sysdeps/mach/hurd/Makefile
> @@ -224,7 +224,7 @@ sysdep_headers += nfs/nfs.h
>  endif
>  
>  ifeq ($(subdir),socket)
> -sysdep_headers += net/ethernet.h net/if_ether.h net/route.h
> +sysdep_headers += net/route.h
>  endif
>  
>  ifeq ($(subdir),nis)
> diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
> index 1efeac5213..4dd5b0013c 100644
> --- a/sysdeps/unix/sysv/linux/Makefile
> +++ b/sysdeps/unix/sysv/linux/Makefile
> @@ -476,7 +476,6 @@ endif
>  ifeq ($(subdir),socket)
>  sysdep_headers += \
>    bits/socket-constants.h \
> -  net/ethernet.h \
>    net/if_packet.h \
>    net/if_ppp.h \
>    net/if_shaper.h \
> diff --git a/sysdeps/unix/sysv/linux/net/if_ether.h b/sysdeps/unix/sysv/linux/net/if_ether.h
> new file mode 100644
> index 0000000000..060ef22070
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/net/if_ether.h
> @@ -0,0 +1 @@
> +#include <linux/if_ether.h>
> -- 
> 2.53.0
> 

-- 
Samuel
«Le monochrome, c'est pour ceux qui s'intéressent (encore) au contenu. 
 Usenet dans ces conditions, c'est comme le web avec lynx, on prend 
 trop conscience du vide, c'est déprimant.»
    -+- JLC in Guide du linuxien pervers : "Coup de cafard..." -+-
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.