lkml.org 
[lkml]   [2022]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] net, uapi: remove inclusion of arpa/inet.h
On Wed, Mar 30, 2022 at 12:26 AM Nick Desaulniers
<ndesaulniers@google.com> wrote:
> On Tue, Mar 29, 2022 at 3:09 PM Nick Desaulniers <ndesaulniers@google.com> wrote:
> ```
> diff --git a/include/uapi/linux/byteorder/little_endian.h
> b/include/uapi/linux/byteorder/little_endian.h
> index cd98982e7523..c14f2c3728e2 100644
> --- a/include/uapi/linux/byteorder/little_endian.h
> +++ b/include/uapi/linux/byteorder/little_endian.h
> @@ -103,5 +103,8 @@ static __always_inline __u16 __be16_to_cpup(const __be16 *p)
> #define __cpu_to_be16s(x) __swab16s((x))
> #define __be16_to_cpus(x) __swab16s((x))
>
> +#define htonl(x) __cpu_to_be32(x)
> +#define htons(x) __cpu_to_be16(x)
> +#define ntohs(x) __be16_to_cpu(x)
>

This is unfortunately a namespace violation, you can't define things in uapi
headers that conflict with standard library interfaces.

Arnd

\
 
 \ /
  Last update: 2022-03-30 08:10    [W:0.085 / U:0.912 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site