netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net, uapi: remove inclusion of arpa/inet.h
@ 2022-03-29 21:29 Nick Desaulniers
  2022-03-29 21:50 ` Nick Desaulniers
  0 siblings, 1 reply; 12+ messages in thread
From: Nick Desaulniers @ 2022-03-29 21:29 UTC (permalink / raw)
  To: Jon Maloy, Ying Xue
  Cc: Nick Desaulniers, Nathan Chancellor, netdev, tipc-discussion,
	linux-kernel, llvm

Testing out CONFIG_UAPI_HEADER_TEST=y with a prebuilt Bionic sysroot
from Android's SDK, I encountered an error:

  HDRTEST usr/include/linux/fsi.h
In file included from <built-in>:1:
In file included from ./usr/include/linux/tipc_config.h:46:
prebuilts/ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/arpa/inet.h:39:1:
error: unknown type name 'in_addr_t'
in_addr_t inet_addr(const char* __s);
^

This is because Bionic has a bug in its inclusion chain. I sent a patch
to fix that, but looking closer at include/uapi/linux/tipc_config.h,
there's a comment that it includes arpa/inet.h for ntohs; but ntohs is
already defined in include/linux/byteorder/generic.h which is already
included in include/uapi/linux/tipc_config.h. There are no __KERNEL__
guards on include/linux/byteorder/generic.h's definition of ntohs. So
besides fixing Bionic, it looks like we can additionally remove this
unnecessary header inclusion.

Link: https://android-review.googlesource.com/c/platform/bionic/+/2048127
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
---
 include/uapi/linux/tipc_config.h | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/include/uapi/linux/tipc_config.h b/include/uapi/linux/tipc_config.h
index 4dfc05651c98..b38374d5f192 100644
--- a/include/uapi/linux/tipc_config.h
+++ b/include/uapi/linux/tipc_config.h
@@ -43,10 +43,6 @@
 #include <linux/tipc.h>
 #include <asm/byteorder.h>
 
-#ifndef __KERNEL__
-#include <arpa/inet.h> /* for ntohs etc. */
-#endif
-
 /*
  * Configuration
  *

base-commit: 5efabdadcf4a5b9a37847ecc85ba71cf2eff0fcf
prerequisite-patch-id: 0c2abf2af8051f4b37a70ef11b7d2fc2a3ec7181
-- 
2.35.1.1021.g381101b075-goog


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-04-06 15:49 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-29 21:29 [PATCH] net, uapi: remove inclusion of arpa/inet.h Nick Desaulniers
2022-03-29 21:50 ` Nick Desaulniers
2022-03-29 22:09   ` Nick Desaulniers
2022-03-29 22:26     ` Nick Desaulniers
2022-03-29 22:39       ` [PATCH v2] " Nick Desaulniers
2022-03-29 23:01         ` Jakub Kicinski
2022-03-29 23:12           ` Nick Desaulniers
2022-04-04 17:54           ` [PATCH net-next v3] " Nick Desaulniers
2022-04-06 13:10             ` patchwork-bot+netdevbpf
2022-03-30  6:08       ` [PATCH] " Arnd Bergmann
2022-03-30  6:11         ` Arnd Bergmann
2022-03-29 23:03     ` Nick Desaulniers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).