netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v05 21/72] include/uapi/linux/if_pppox.h: include linux/if.h
       [not found] <1471890809-4383-1-git-send-email-mikko.rapeli@iki.fi>
@ 2016-08-22 18:32 ` Mikko Rapeli
  2016-08-22 19:37   ` Stephen Hemminger
  2016-08-22 23:33   ` David Miller
  2016-08-22 18:32 ` [PATCH v05 22/72] include/uapi/linux/if_tunnel.h: include linux/if.h, linux/ip.h and linux/in6.h Mikko Rapeli
                   ` (10 subsequent siblings)
  11 siblings, 2 replies; 26+ messages in thread
From: Mikko Rapeli @ 2016-08-22 18:32 UTC (permalink / raw)
  To: linux-kernel; +Cc: Mikko Rapeli, netdev

Fixes userspace compilation error:

error: ‘IFNAMSIZ’ undeclared here (not in a function)

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/linux/if_pppox.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/uapi/linux/if_pppox.h b/include/uapi/linux/if_pppox.h
index e128769..473c3c4 100644
--- a/include/uapi/linux/if_pppox.h
+++ b/include/uapi/linux/if_pppox.h
@@ -21,6 +21,7 @@
 #include <asm/byteorder.h>
 
 #include <linux/socket.h>
+#include <linux/if.h>
 #include <linux/if_ether.h>
 #include <linux/if_pppol2tp.h>
 
-- 
2.8.1

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

* [PATCH v05 22/72] include/uapi/linux/if_tunnel.h: include linux/if.h, linux/ip.h and linux/in6.h
       [not found] <1471890809-4383-1-git-send-email-mikko.rapeli@iki.fi>
  2016-08-22 18:32 ` [PATCH v05 21/72] include/uapi/linux/if_pppox.h: include linux/if.h Mikko Rapeli
@ 2016-08-22 18:32 ` Mikko Rapeli
  2016-08-22 23:28   ` David Miller
  2016-08-22 18:32 ` [PATCH v05 25/72] include/uapi/linux/if_pppol2tp.h: include linux/in.h " Mikko Rapeli
                   ` (9 subsequent siblings)
  11 siblings, 1 reply; 26+ messages in thread
From: Mikko Rapeli @ 2016-08-22 18:32 UTC (permalink / raw)
  To: linux-kernel
  Cc: Mikko Rapeli, Stephen Hemminger, David S. Miller,
	Philip Prindeville, netdev

Fixes userspace compilation errors like:

error: field ‘iph’ has incomplete type
error: field ‘prefix’ has incomplete type

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/linux/if_tunnel.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/uapi/linux/if_tunnel.h b/include/uapi/linux/if_tunnel.h
index 1046f55..777b6cd 100644
--- a/include/uapi/linux/if_tunnel.h
+++ b/include/uapi/linux/if_tunnel.h
@@ -2,6 +2,9 @@
 #define _UAPI_IF_TUNNEL_H_
 
 #include <linux/types.h>
+#include <linux/if.h>
+#include <linux/ip.h>
+#include <linux/in6.h>
 #include <asm/byteorder.h>
 
 
-- 
2.8.1

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

* [PATCH v05 25/72] include/uapi/linux/if_pppol2tp.h: include linux/in.h and linux/in6.h
       [not found] <1471890809-4383-1-git-send-email-mikko.rapeli@iki.fi>
  2016-08-22 18:32 ` [PATCH v05 21/72] include/uapi/linux/if_pppox.h: include linux/if.h Mikko Rapeli
  2016-08-22 18:32 ` [PATCH v05 22/72] include/uapi/linux/if_tunnel.h: include linux/if.h, linux/ip.h and linux/in6.h Mikko Rapeli
@ 2016-08-22 18:32 ` Mikko Rapeli
  2016-08-22 23:31   ` David Miller
  2016-08-22 18:32 ` [PATCH v05 26/72] include/uapi/linux/if_pppox.h: " Mikko Rapeli
                   ` (8 subsequent siblings)
  11 siblings, 1 reply; 26+ messages in thread
From: Mikko Rapeli @ 2016-08-22 18:32 UTC (permalink / raw)
  To: linux-kernel; +Cc: Mikko Rapeli, James Chapman, netdev

Fixes userspace compilation errors like:

error: field ‘addr’ has incomplete type
 struct sockaddr_in addr; /* IP address and port to send to */
                    ^
error: field ‘addr’ has incomplete type
 struct sockaddr_in6 addr; /* IP address and port to send to */

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/linux/if_pppol2tp.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/uapi/linux/if_pppol2tp.h b/include/uapi/linux/if_pppol2tp.h
index 163e8ad..4bd1f55 100644
--- a/include/uapi/linux/if_pppol2tp.h
+++ b/include/uapi/linux/if_pppol2tp.h
@@ -16,7 +16,8 @@
 #define _UAPI__LINUX_IF_PPPOL2TP_H
 
 #include <linux/types.h>
-
+#include <linux/in.h>
+#include <linux/in6.h>
 
 /* Structure used to connect() the socket to a particular tunnel UDP
  * socket over IPv4.
-- 
2.8.1

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

* [PATCH v05 26/72] include/uapi/linux/if_pppox.h: include linux/in.h and linux/in6.h
       [not found] <1471890809-4383-1-git-send-email-mikko.rapeli@iki.fi>
                   ` (2 preceding siblings ...)
  2016-08-22 18:32 ` [PATCH v05 25/72] include/uapi/linux/if_pppol2tp.h: include linux/in.h " Mikko Rapeli
@ 2016-08-22 18:32 ` Mikko Rapeli
  2016-08-22 23:31   ` David Miller
       [not found] ` <1471890809-4383-1-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
                   ` (7 subsequent siblings)
  11 siblings, 1 reply; 26+ messages in thread
From: Mikko Rapeli @ 2016-08-22 18:32 UTC (permalink / raw)
  To: linux-kernel; +Cc: Mikko Rapeli, netdev

Fixes userspace compilation errors:

error: field ‘addr’ has incomplete type
 struct sockaddr_in addr; /* IP address and port to send to */

error: field ‘addr’ has incomplete type
 struct sockaddr_in6 addr; /* IP address and port to send to */

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/linux/if_pppox.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/uapi/linux/if_pppox.h b/include/uapi/linux/if_pppox.h
index 473c3c4..d37bbb1 100644
--- a/include/uapi/linux/if_pppox.h
+++ b/include/uapi/linux/if_pppox.h
@@ -24,6 +24,8 @@
 #include <linux/if.h>
 #include <linux/if_ether.h>
 #include <linux/if_pppol2tp.h>
+#include <linux/in.h>
+#include <linux/in6.h>
 
 /* For user-space programs to pick up these definitions
  * which they wouldn't get otherwise without defining __KERNEL__
-- 
2.8.1

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

* [PATCH v05 38/72] include/uapi/linux/openvswitch.h: use __u32 from linux/types.h
       [not found] ` <1471890809-4383-1-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
@ 2016-08-22 18:32   ` Mikko Rapeli
  2016-08-22 19:39     ` Stephen Hemminger
       [not found]     ` <1471890809-4383-39-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
  0 siblings, 2 replies; 26+ messages in thread
From: Mikko Rapeli @ 2016-08-22 18:32 UTC (permalink / raw)
  To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: dev-yBygre7rU0TnMu66kgdUjQ, Mikko Rapeli,
	netdev-u79uwXL29TY76Z2rM5mHXA

Fixes userspace compiler error:

error: unknown type name ‘uint32_t’

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/linux/openvswitch.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/uapi/linux/openvswitch.h b/include/uapi/linux/openvswitch.h
index d95a301..645499a 100644
--- a/include/uapi/linux/openvswitch.h
+++ b/include/uapi/linux/openvswitch.h
@@ -632,8 +632,8 @@ enum ovs_hash_alg {
  * @hash_basis: basis used for computing hash.
  */
 struct ovs_action_hash {
-	uint32_t  hash_alg;     /* One of ovs_hash_alg. */
-	uint32_t  hash_basis;
+	__u32  hash_alg;     /* One of ovs_hash_alg. */
+	__u32  hash_basis;
 };
 
 /**
-- 
2.8.1

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

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

* [PATCH v05 41/72] include/uapi/linux/atm_zatm.h: include linux/time.h
       [not found] <1471890809-4383-1-git-send-email-mikko.rapeli@iki.fi>
                   ` (4 preceding siblings ...)
       [not found] ` <1471890809-4383-1-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
@ 2016-08-22 18:32 ` Mikko Rapeli
  2016-08-22 23:30   ` David Miller
  2016-08-22 18:33 ` [PATCH v05 62/72] include/uapi/linux/openvswitch.h: use __u32 from linux/types.h Mikko Rapeli
                   ` (5 subsequent siblings)
  11 siblings, 1 reply; 26+ messages in thread
From: Mikko Rapeli @ 2016-08-22 18:32 UTC (permalink / raw)
  To: linux-kernel; +Cc: Mikko Rapeli, Chas Williams, linux-atm-general, netdev

Fixes userspace compile error:

error: field ‘real’ has incomplete type
 struct timeval real;  /* real (wall-clock) time */

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/linux/atm_zatm.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/uapi/linux/atm_zatm.h b/include/uapi/linux/atm_zatm.h
index 9c9c6ad..5cd4d4d 100644
--- a/include/uapi/linux/atm_zatm.h
+++ b/include/uapi/linux/atm_zatm.h
@@ -14,6 +14,7 @@
 
 #include <linux/atmapi.h>
 #include <linux/atmioc.h>
+#include <linux/time.h>
 
 #define ZATM_GETPOOL	_IOW('a',ATMIOC_SARPRV+1,struct atmif_sioc)
 						/* get pool statistics */
-- 
2.8.1

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

* [PATCH v05 62/72] include/uapi/linux/openvswitch.h: use __u32 from linux/types.h
       [not found] <1471890809-4383-1-git-send-email-mikko.rapeli@iki.fi>
                   ` (5 preceding siblings ...)
  2016-08-22 18:32 ` [PATCH v05 41/72] include/uapi/linux/atm_zatm.h: include linux/time.h Mikko Rapeli
@ 2016-08-22 18:33 ` Mikko Rapeli
       [not found]   ` <1471890809-4383-63-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
  2016-08-22 18:33 ` [PATCH v05 64/72] include/uapi/linux/ipx.h: fix conflicting defitions with glibc netipx/ipx.h Mikko Rapeli
                   ` (4 subsequent siblings)
  11 siblings, 1 reply; 26+ messages in thread
From: Mikko Rapeli @ 2016-08-22 18:33 UTC (permalink / raw)
  To: linux-kernel; +Cc: Mikko Rapeli, Pravin Shelar, netdev, dev

Kernel uapi header are supposed to use them. Fixes userspace compile error:

linux/openvswitch.h:583:2: error: unknown type name ‘uint32_t’

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/linux/openvswitch.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/uapi/linux/openvswitch.h b/include/uapi/linux/openvswitch.h
index 645499a..54c3b4f 100644
--- a/include/uapi/linux/openvswitch.h
+++ b/include/uapi/linux/openvswitch.h
@@ -583,7 +583,7 @@ enum ovs_userspace_attr {
 #define OVS_USERSPACE_ATTR_MAX (__OVS_USERSPACE_ATTR_MAX - 1)
 
 struct ovs_action_trunc {
-	uint32_t max_len; /* Max packet size in bytes. */
+	__u32 max_len; /* Max packet size in bytes. */
 };
 
 /**
-- 
2.8.1

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

* [PATCH v05 64/72] include/uapi/linux/ipx.h: fix conflicting defitions with glibc netipx/ipx.h
       [not found] <1471890809-4383-1-git-send-email-mikko.rapeli@iki.fi>
                   ` (6 preceding siblings ...)
  2016-08-22 18:33 ` [PATCH v05 62/72] include/uapi/linux/openvswitch.h: use __u32 from linux/types.h Mikko Rapeli
@ 2016-08-22 18:33 ` Mikko Rapeli
  2016-08-22 23:33   ` David Miller
  2016-08-22 18:33 ` [PATCH v05 66/72] uapi icmp.h: glibc netinet/ip_icmp.h header file compatibility fixes Mikko Rapeli
                   ` (3 subsequent siblings)
  11 siblings, 1 reply; 26+ messages in thread
From: Mikko Rapeli @ 2016-08-22 18:33 UTC (permalink / raw)
  To: linux-kernel
  Cc: Mikko Rapeli, Arnaldo Carvalho de Melo, David S. Miller,
	Nicolas Dichtel, netdev

Fixes these compiler warnings via libc-compat.h when glibc netipx/ipx.h is
included before linux/ipx.h:

./linux/ipx.h:9:8: error: redefinition of ‘struct sockaddr_ipx’
./linux/ipx.h:26:8: error: redefinition of ‘struct ipx_route_definition’
./linux/ipx.h:32:8: error: redefinition of ‘struct ipx_interface_definition’
./linux/ipx.h:49:8: error: redefinition of ‘struct ipx_config_data’
./linux/ipx.h:58:8: error: redefinition of ‘struct ipx_route_def’

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/linux/ipx.h         | 13 ++++++++++++-
 include/uapi/linux/libc-compat.h | 26 ++++++++++++++++++++++++++
 2 files changed, 38 insertions(+), 1 deletion(-)

diff --git a/include/uapi/linux/ipx.h b/include/uapi/linux/ipx.h
index 3d48014..30f031d 100644
--- a/include/uapi/linux/ipx.h
+++ b/include/uapi/linux/ipx.h
@@ -1,11 +1,13 @@
 #ifndef _IPX_H_
 #define _IPX_H_
+#include <linux/libc-compat.h>	/* for compatibility with glibc netipx/ipx.h */
 #include <linux/types.h>
 #include <linux/sockios.h>
 #include <linux/socket.h>
 #define IPX_NODE_LEN	6
 #define IPX_MTU		576
 
+#if __UAPI_DEF_SOCKADDR_IPX
 struct sockaddr_ipx {
 	__kernel_sa_family_t sipx_family;
 	__be16		sipx_port;
@@ -14,6 +16,7 @@ struct sockaddr_ipx {
 	__u8		sipx_type;
 	unsigned char	sipx_zero;	/* 16 byte fill */
 };
+#endif /* __UAPI_DEF_SOCKADDR_IPX */
 
 /*
  * So we can fit the extra info for SIOCSIFADDR into the address nicely
@@ -23,12 +26,15 @@ struct sockaddr_ipx {
 #define IPX_DLTITF	0
 #define IPX_CRTITF	1
 
+#if __UAPI_DEF_IPX_ROUTE_DEFINITION
 struct ipx_route_definition {
 	__be32        ipx_network;
 	__be32        ipx_router_network;
 	unsigned char ipx_router_node[IPX_NODE_LEN];
 };
+#endif /* __UAPI_DEF_IPX_ROUTE_DEFINITION */
 
+#if __UAPI_DEF_IPX_INTERFACE_DEFINITION
 struct ipx_interface_definition {
 	__be32        ipx_network;
 	unsigned char ipx_device[16];
@@ -45,16 +51,20 @@ struct ipx_interface_definition {
 #define IPX_INTERNAL		2
 	unsigned char ipx_node[IPX_NODE_LEN];
 };
-	
+#endif /* __UAPI_DEF_IPX_INTERFACE_DEFINITION */
+
+#if __UAPI_DEF_IPX_CONFIG_DATA
 struct ipx_config_data {
 	unsigned char	ipxcfg_auto_select_primary;
 	unsigned char	ipxcfg_auto_create_interfaces;
 };
+#endif /* __UAPI_DEF_IPX_CONFIG_DATA */
 
 /*
  * OLD Route Definition for backward compatibility.
  */
 
+#if __UAPI_DEF_IPX_ROUTE_DEF
 struct ipx_route_def {
 	__be32		ipx_network;
 	__be32		ipx_router_network;
@@ -67,6 +77,7 @@ struct ipx_route_def {
 #define IPX_RT_BLUEBOOK		2
 #define IPX_RT_ROUTED		1
 };
+#endif /* __UAPI_DEF_IPX_ROUTE_DEF */
 
 #define SIOCAIPXITFCRT		(SIOCPROTOPRIVATE)
 #define SIOCAIPXPRISLT		(SIOCPROTOPRIVATE + 1)
diff --git a/include/uapi/linux/libc-compat.h b/include/uapi/linux/libc-compat.h
index e4f048e..44b8a6b 100644
--- a/include/uapi/linux/libc-compat.h
+++ b/include/uapi/linux/libc-compat.h
@@ -139,6 +139,25 @@
 
 #endif /* _NETINET_IN_H */
 
+/* Coordinate with glibc netipx/ipx.h header. */
+#if defined(__NETIPX_IPX_H)
+
+#define __UAPI_DEF_SOCKADDR_IPX			0
+#define __UAPI_DEF_IPX_ROUTE_DEFINITION		0
+#define __UAPI_DEF_IPX_INTERFACE_DEFINITION	0
+#define __UAPI_DEF_IPX_CONFIG_DATA		0
+#define __UAPI_DEF_IPX_ROUTE_DEF		0
+
+#else /* defined(__NETIPX_IPX_H) */
+
+#define __UAPI_DEF_SOCKADDR_IPX			1
+#define __UAPI_DEF_IPX_ROUTE_DEFINITION		1
+#define __UAPI_DEF_IPX_INTERFACE_DEFINITION	1
+#define __UAPI_DEF_IPX_CONFIG_DATA		1
+#define __UAPI_DEF_IPX_ROUTE_DEF		1
+
+#endif /* defined(__NETIPX_IPX_H) */
+
 /* Definitions for xattr.h */
 #if defined(_SYS_XATTR_H)
 #define __UAPI_DEF_XATTR		0
@@ -179,6 +198,13 @@
 #define __UAPI_DEF_IN6_PKTINFO		1
 #define __UAPI_DEF_IP6_MTUINFO		1
 
+/* Definitions for ipx.h */
+#define __UAPI_DEF_SOCKADDR_IPX			1
+#define __UAPI_DEF_IPX_ROUTE_DEFINITION		1
+#define __UAPI_DEF_IPX_INTERFACE_DEFINITION	1
+#define __UAPI_DEF_IPX_CONFIG_DATA		1
+#define __UAPI_DEF_IPX_ROUTE_DEF		1
+
 /* Definitions for xattr.h */
 #define __UAPI_DEF_XATTR		1
 
-- 
2.8.1

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

* [PATCH v05 66/72] uapi icmp.h: glibc netinet/ip_icmp.h header file compatibility fixes
       [not found] <1471890809-4383-1-git-send-email-mikko.rapeli@iki.fi>
                   ` (7 preceding siblings ...)
  2016-08-22 18:33 ` [PATCH v05 64/72] include/uapi/linux/ipx.h: fix conflicting defitions with glibc netipx/ipx.h Mikko Rapeli
@ 2016-08-22 18:33 ` Mikko Rapeli
  2016-08-22 18:33 ` [PATCH v05 68/72] uapi ax25.h: glibc netax25/ax25.h " Mikko Rapeli
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 26+ messages in thread
From: Mikko Rapeli @ 2016-08-22 18:33 UTC (permalink / raw)
  To: linux-kernel; +Cc: Mikko Rapeli, David S. Miller, Eric Dumazet, Nicolas Dichtel

Fixes this userspace compile error when glibc netinet/ip_icmp.h is included
before linux/icmp.h:

linux/icmp.h:68:8: error: redefinition of ‘struct icmphdr’

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/linux/icmp.h        |  4 +++-
 include/uapi/linux/libc-compat.h | 10 ++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/include/uapi/linux/icmp.h b/include/uapi/linux/icmp.h
index fddd9d7..cd38005 100644
--- a/include/uapi/linux/icmp.h
+++ b/include/uapi/linux/icmp.h
@@ -17,6 +17,7 @@
 #ifndef _UAPI_LINUX_ICMP_H
 #define _UAPI_LINUX_ICMP_H
 
+#include <linux/libc-compat.h>
 #include <linux/types.h>
 
 #define ICMP_ECHOREPLY		0	/* Echo Reply			*/
@@ -64,7 +65,7 @@
 #define ICMP_EXC_TTL		0	/* TTL count exceeded		*/
 #define ICMP_EXC_FRAGTIME	1	/* Fragment Reass time exceeded	*/
 
-
+#if __UAPI_DEF_ICMPHDR
 struct icmphdr {
   __u8		type;
   __u8		code;
@@ -82,6 +83,7 @@ struct icmphdr {
 	__u8	reserved[4];
   } un;
 };
+#endif /* __UAPI_DEF_ICMPHDR */
 
 
 /*
diff --git a/include/uapi/linux/libc-compat.h b/include/uapi/linux/libc-compat.h
index 40190a4..8a5a7cc 100644
--- a/include/uapi/linux/libc-compat.h
+++ b/include/uapi/linux/libc-compat.h
@@ -154,6 +154,13 @@
 
 #endif /* _NETINET_IN_H */
 
+/* Coordinate with glibc netinet/ip_icmp.h header. */
+#if defined(__NETINET_IP_ICMP_H)
+#define __UAPI_DEF_ICMPHDR		0
+#else /* defined(__NETINET_IP_ICMP_H) */
+#define __UAPI_DEF_ICMPHDR		1
+#endif /* defined(__NETINET_IP_ICMP_H) */
+
 /* Coordinate with glibc netipx/ipx.h header. */
 #if defined(__NETIPX_IPX_H)
 
@@ -218,6 +225,9 @@
 #define __UAPI_DEF_IN6_PKTINFO		1
 #define __UAPI_DEF_IP6_MTUINFO		1
 
+/* Definitions for icmp.h */
+#define __UAPI_DEF_ICMPHDR		1
+
 /* Definitions for ipx.h */
 #define __UAPI_DEF_SOCKADDR_IPX			1
 #define __UAPI_DEF_IPX_ROUTE_DEFINITION		1
-- 
2.8.1

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

* [PATCH v05 68/72] uapi ax25.h: glibc netax25/ax25.h header file compatibility fixes
       [not found] <1471890809-4383-1-git-send-email-mikko.rapeli@iki.fi>
                   ` (8 preceding siblings ...)
  2016-08-22 18:33 ` [PATCH v05 66/72] uapi icmp.h: glibc netinet/ip_icmp.h header file compatibility fixes Mikko Rapeli
@ 2016-08-22 18:33 ` Mikko Rapeli
  2016-08-22 18:33 ` [PATCH v05 69/72] uapi rose.h: glibc netrose/rose.h " Mikko Rapeli
  2016-08-22 18:33 ` [PATCH v05 72/72] uapi route.h: glibc net/route.h compat fix Mikko Rapeli
  11 siblings, 0 replies; 26+ messages in thread
From: Mikko Rapeli @ 2016-08-22 18:33 UTC (permalink / raw)
  To: linux-kernel
  Cc: Mikko Rapeli, Ralf Baechle, David S. Miller, Nicolas Dichtel,
	linux-hams

Fixes these userspace compile error when glibc netax25/ax25.h is included
before linux/ax25.h:

linux/ax25.h:28:0: warning: "SIOCAX25GETUID" redefined
linux/ax25.h:38:0: warning: "SIOCAX25GETINFO" redefined
linux/ax25.h:47:3: error: conflicting types for ‘ax25_address’
linux/ax25.h:49:8: error: redefinition of ‘struct sockaddr_ax25’
linux/ax25.h:58:8: error: redefinition of ‘struct full_sockaddr_ax25’
linux/ax25.h:63:8: error: redefinition of ‘struct ax25_routes_struct’
linux/ax25.h:70:8: error: redefinition of ‘struct ax25_route_opt_struct’
linux/ax25.h:77:8: error: redefinition of ‘struct ax25_ctl_struct’
linux/ax25.h:98:8: error: redefinition of ‘struct ax25_info_struct’
linux/ax25.h:111:8: error: redefinition of ‘struct ax25_fwd_struct’

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/linux/ax25.h        | 22 +++++++++++++++++++++
 include/uapi/linux/libc-compat.h | 41 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 63 insertions(+)

diff --git a/include/uapi/linux/ax25.h b/include/uapi/linux/ax25.h
index 74c89a4..e296c8a 100644
--- a/include/uapi/linux/ax25.h
+++ b/include/uapi/linux/ax25.h
@@ -6,6 +6,7 @@
 #ifndef	AX25_KERNEL_H
 #define	AX25_KERNEL_H
 
+#include <linux/libc-compat.h>
 #include <linux/socket.h>
 
 #define AX25_MTU	256
@@ -25,6 +26,7 @@
 
 #define AX25_KILL	99
 
+#if __UAPI_DEF_SIOCAX25GETUID_TO_SIOCAX25DELFWD
 #define SIOCAX25GETUID		(SIOCPROTOPRIVATE+0)
 #define SIOCAX25ADDUID		(SIOCPROTOPRIVATE+1)
 #define SIOCAX25DELUID		(SIOCPROTOPRIVATE+2)
@@ -34,46 +36,61 @@
 #define SIOCAX25GETINFOOLD	(SIOCPROTOPRIVATE+9)
 #define SIOCAX25ADDFWD		(SIOCPROTOPRIVATE+10)
 #define SIOCAX25DELFWD		(SIOCPROTOPRIVATE+11)
+#endif /* __UAPI_DEF_SIOCAX25GETUID_TO_SIOCAX25DELFWD */
 #define SIOCAX25DEVCTL          (SIOCPROTOPRIVATE+12)
+/* glibc uses SIOCPROTOPRIVATE+9 for SIOCAX25GETINFO */
+#if __UAPI_DEF_SIOCAX25GETINFO
 #define SIOCAX25GETINFO         (SIOCPROTOPRIVATE+13)
+#endif /* __UAPI_DEF_SIOCAX25GETINFO */
 
 #define AX25_SET_RT_IPMODE	2
 
 #define AX25_NOUID_DEFAULT	0
 #define AX25_NOUID_BLOCK	1
 
+#if __UAPI_DEF_AX25_ADDRESS
 typedef struct {
 	char		ax25_call[7];	/* 6 call + SSID (shifted ascii!) */
 } ax25_address;
+#endif /* __UAPI_DEF_AX25_ADDRESS */
 
+#if __UAPI_DEF_SOCKADDR_AX25
 struct sockaddr_ax25 {
 	__kernel_sa_family_t sax25_family;
 	ax25_address	sax25_call;
 	int		sax25_ndigis;
 	/* Digipeater ax25_address sets follow */
 };
+#endif /* __UAPI_DEF_SOCKADDR_AX25 */
 
 #define sax25_uid	sax25_ndigis
 
+#if __UAPI_DEF_FULL_SOCKADDR_AX25
 struct full_sockaddr_ax25 {
 	struct sockaddr_ax25 fsa_ax25;
 	ax25_address	fsa_digipeater[AX25_MAX_DIGIS];
 };
+#endif /* __UAPI_DEF_FULL_SOCKADDR_AX25 */
 
+#if __UAPI_DEF_AX25_ROUTES_STRUCT
 struct ax25_routes_struct {
 	ax25_address	port_addr;
 	ax25_address	dest_addr;
 	unsigned char	digi_count;
 	ax25_address	digi_addr[AX25_MAX_DIGIS];
 };
+#endif /* __UAPI_DEF_AX25_ROUTES_STRUCT */
 
+#if __UAPI_DEF_AX25_ROUTES_OPT_STRUCT
 struct ax25_route_opt_struct {
 	ax25_address	port_addr;
 	ax25_address	dest_addr;
 	int		cmd;
 	int		arg;
 };
+#endif /* __UAPI_DEF_AX25_ROUTES_OPT_STRUCT */
 
+#if __UAPI_DEF_AX25_CTL_STRUCT
 struct ax25_ctl_struct {
         ax25_address            port_addr;
         ax25_address            source_addr;
@@ -83,6 +100,7 @@ struct ax25_ctl_struct {
         unsigned char           digi_count;
         ax25_address            digi_addr[AX25_MAX_DIGIS];
 };
+#endif /* __UAPI_DEF_AX25_CTL_STRUCT */
 
 /* this will go away. Please do not export to user land */
 struct ax25_info_struct_deprecated {
@@ -95,6 +113,7 @@ struct ax25_info_struct_deprecated {
 	unsigned int	rcv_q, snd_q;
 };
 
+#if __UAPI_DEF_AX25_INFO_STRUCT
 struct ax25_info_struct {
 	unsigned int	n2, n2count;
 	unsigned int	t1, t1timer;
@@ -107,10 +126,13 @@ struct ax25_info_struct {
 	unsigned int	paclen;
 	unsigned int	window;
 };
+#endif /* __UAPI_DEF_AX25_INFO_STRUCT */
 
+#if __UAPI_DEF_AX25_FWD_STRUCT
 struct ax25_fwd_struct {
 	ax25_address	port_from;
 	ax25_address	port_to;
 };
+#endif /* __UAPI_DEF_AX25_FWD_STRUCT */
 
 #endif
diff --git a/include/uapi/linux/libc-compat.h b/include/uapi/linux/libc-compat.h
index f793b09..01bb521 100644
--- a/include/uapi/linux/libc-compat.h
+++ b/include/uapi/linux/libc-compat.h
@@ -100,6 +100,35 @@
 
 #endif /* _NET_IF_H */
 
+/* Coordinate with glibc netax25/ax25.h header. */
+#if defined(_NETAX25_AX25_H)
+
+#define __UAPI_DEF_SIOCAX25GETUID_TO_SIOCAX25DELFWD	0
+#define __UAPI_DEF_SIOCAX25GETINFO			0
+#define __UAPI_DEF_AX25_ADDRESS				0
+#define __UAPI_DEF_SOCKADDR_AX25			0
+#define __UAPI_DEF_FULL_SOCKADDR_AX25			0
+#define __UAPI_DEF_AX25_ROUTES_STRUCT			0
+#define __UAPI_DEF_AX25_ROUTES_OPT_STRUCT		0
+#define __UAPI_DEF_AX25_CTL_STRUCT			0
+#define __UAPI_DEF_AX25_INFO_STRUCT			0
+#define __UAPI_DEF_AX25_FWD_STRUCT			0
+
+#else /* defined(_NETAX25_AX25_H) */
+
+#define __UAPI_DEF_SIOCAX25GETUID_TO_SIOCAX25DELFWD	1
+#define __UAPI_DEF_SIOCAX25GETINFO			1
+#define __UAPI_DEF_AX25_ADDRESS				1
+#define __UAPI_DEF_SOCKADDR_AX25			1
+#define __UAPI_DEF_FULL_SOCKADDR_AX25			1
+#define __UAPI_DEF_AX25_ROUTES_STRUCT			1
+#define __UAPI_DEF_AX25_ROUTES_OPT_STRUCT		1
+#define __UAPI_DEF_AX25_CTL_STRUCT			1
+#define __UAPI_DEF_AX25_INFO_STRUCT			1
+#define __UAPI_DEF_AX25_FWD_STRUCT			1
+
+#endif /* defined(_NETAX25_AX25_H) */
+
 /* Coordinate with glibc netinet/in.h header. */
 #if defined(_NETINET_IN_H)
 
@@ -204,6 +233,18 @@
 #define __UAPI_DEF_F_DUPFD_CLOEXEC		1
 #define __UAPI_DEF_O_ACCMODE_RDONLY_WRONLY_RDWR	1
 
+/* Definitions for ax25.h */
+#define __UAPI_DEF_SIOCAX25GETUID_TO_SIOCAX25DELFWD	1
+#define __UAPI_DEF_SIOCAX25GETINFO			1
+#define __UAPI_DEF_AX25_ADDRESS				1
+#define __UAPI_DEF_SOCKADDR_AX25			1
+#define __UAPI_DEF_FULL_SOCKADDR_AX25			1
+#define __UAPI_DEF_AX25_ROUTES_STRUCT			1
+#define __UAPI_DEF_AX25_ROUTES_OPT_STRUCT		1
+#define __UAPI_DEF_AX25_CTL_STRUCT			1
+#define __UAPI_DEF_AX25_INFO_STRUCT			1
+#define __UAPI_DEF_AX25_FWD_STRUCT			1
+
 /* Definitions for if.h */
 #define __UAPI_DEF_IF_IFCONF 1
 #define __UAPI_DEF_IF_IFMAP 1
-- 
2.8.1

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

* [PATCH v05 69/72] uapi rose.h: glibc netrose/rose.h header file compatibility fixes
       [not found] <1471890809-4383-1-git-send-email-mikko.rapeli@iki.fi>
                   ` (9 preceding siblings ...)
  2016-08-22 18:33 ` [PATCH v05 68/72] uapi ax25.h: glibc netax25/ax25.h " Mikko Rapeli
@ 2016-08-22 18:33 ` Mikko Rapeli
  2016-08-22 18:33 ` [PATCH v05 72/72] uapi route.h: glibc net/route.h compat fix Mikko Rapeli
  11 siblings, 0 replies; 26+ messages in thread
From: Mikko Rapeli @ 2016-08-22 18:33 UTC (permalink / raw)
  To: linux-kernel
  Cc: Mikko Rapeli, Ralf Baechle, David S. Miller, Nicolas Dichtel,
	linux-hams

Fixes these userspace compile errors and warnings when glibc
netrose/rose.h is included before linux/rose.h:

linux/rose.h:25:0: warning: "SIOCRSGCAUSE" redefined
linux/rose.h:26:0: warning: "SIOCRSSCAUSE" redefined
linux/rose.h:27:0: warning: "SIOCRSL2CALL" redefined
linux/rose.h:28:0: warning: "SIOCRSSL2CALL" redefined
linux/rose.h:29:0: warning: "SIOCRSACCEPT" redefined
linux/rose.h:30:0: warning: "SIOCRSCLRRT" redefined
linux/rose.h:31:0: warning: "SIOCRSGL2CALL" redefined
linux/rose.h:32:0: warning: "SIOCRSGFACILITIES" redefined
linux/rose.h:47:3: error: conflicting types for ‘rose_address’
linux/rose.h:49:8: error: redefinition of ‘struct sockaddr_rose’
linux/rose.h:57:8: error: redefinition of ‘struct full_sockaddr_rose’
linux/rose.h:65:8: error: redefinition of ‘struct rose_route_struct’
linux/rose.h:74:8: error: redefinition of ‘struct rose_cause_struct’
linux/rose.h:79:8: error: redefinition of ‘struct rose_facilities_struct’

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/linux/libc-compat.h | 30 ++++++++++++++++++++++++++++++
 include/uapi/linux/rose.h        | 15 +++++++++++++++
 2 files changed, 45 insertions(+)

diff --git a/include/uapi/linux/libc-compat.h b/include/uapi/linux/libc-compat.h
index 01bb521..acc2e75 100644
--- a/include/uapi/linux/libc-compat.h
+++ b/include/uapi/linux/libc-compat.h
@@ -209,6 +209,27 @@
 
 #endif /* defined(__NETIPX_IPX_H) */
 
+/* Coordinate with glibc netrose/rose.h */
+#if defined(_NETROSE_ROSE_H)
+#define __UAPI_DEF_SIOCRSGCAUSE_TO_SIOCRSGFACILITIES	0
+#define __UAPI_DEF_ROSE_ADDRESS				0
+#define __UAPI_DEF_SOCKADDR_ROSE			0
+#define __UAPI_DEF_FULL_SOCKADDR_ROSE			0
+#define __UAPI_DEF_ROSE_ROUTE_STRUCT			0
+#define __UAPI_DEF_ROSE_CAUSE_STRUCT			0
+#define __UAPI_DEF_ROSE_FACILITIES_STRUCT		0
+
+#else /* defined(_NETROSE_ROSE_H) */
+#define __UAPI_DEF_SIOCRSGCAUSE_TO_SIOCRSGFACILITIES	1
+#define __UAPI_DEF_ROSE_ADDRESS				1
+#define __UAPI_DEF_SOCKADDR_ROSE			1
+#define __UAPI_DEF_FULL_SOCKADDR_ROSE			1
+#define __UAPI_DEF_ROSE_ROUTE_STRUCT			1
+#define __UAPI_DEF_ROSE_CAUSE_STRUCT			1
+#define __UAPI_DEF_ROSE_FACILITIES_STRUCT		1
+
+#endif /* defined(_NETROSE_ROSE_H) */
+
 /* Definitions for sys/uio.h */
 #if defined(_SYS_UIO_H)
 #define __UAPI_DEF_IOVEC		0
@@ -283,6 +304,15 @@
 #define __UAPI_DEF_IPX_CONFIG_DATA		1
 #define __UAPI_DEF_IPX_ROUTE_DEF		1
 
+/* Definitions for rose.h */
+#define __UAPI_DEF_SIOCRSGCAUSE_TO_SIOCRSGFACILITIES	1
+#define __UAPI_DEF_ROSE_ADDRESS				1
+#define __UAPI_DEF_SOCKADDR_ROSE			1
+#define __UAPI_DEF_FULL_SOCKADDR_ROSE			1
+#define __UAPI_DEF_ROSE_ROUTE_STRUCT			1
+#define __UAPI_DEF_ROSE_CAUSE_STRUCT			1
+#define __UAPI_DEF_ROSE_FACILITIES_STRUCT		1
+
 /* Definitions for uio.h */
 #define __UAPI_DEF_IOVEC		1
 
diff --git a/include/uapi/linux/rose.h b/include/uapi/linux/rose.h
index 1fcfe95..c39499c 100644
--- a/include/uapi/linux/rose.h
+++ b/include/uapi/linux/rose.h
@@ -7,6 +7,7 @@
 #ifndef	ROSE_KERNEL_H
 #define	ROSE_KERNEL_H
 
+#include <linux/libc-compat.h>
 #include <linux/socket.h>
 #include <linux/ax25.h>
 
@@ -22,6 +23,7 @@
 #define	ROSE_QBITINCL	6
 #define	ROSE_HOLDBACK	7
 
+#if __UAPI_DEF_SIOCRSGCAUSE_TO_SIOCRSGFACILITIES
 #define	SIOCRSGCAUSE		(SIOCPROTOPRIVATE+0)
 #define	SIOCRSSCAUSE		(SIOCPROTOPRIVATE+1)
 #define	SIOCRSL2CALL		(SIOCPROTOPRIVATE+2)
@@ -30,6 +32,7 @@
 #define	SIOCRSCLRRT		(SIOCPROTOPRIVATE+4)
 #define	SIOCRSGL2CALL		(SIOCPROTOPRIVATE+5)
 #define	SIOCRSGFACILITIES	(SIOCPROTOPRIVATE+6)
+#endif /* __UAPI_DEF_SIOCRSGCAUSE_TO_SIOCRSGFACILITIES */
 
 #define	ROSE_DTE_ORIGINATED	0x00
 #define	ROSE_NUMBER_BUSY	0x01
@@ -42,10 +45,13 @@
 #define	ROSE_LOCAL_PROCEDURE	0x13
 #define	ROSE_SHIP_ABSENT	0x39
 
+#if __UAPI_DEF_ROSE_ADDRESS
 typedef struct {
 	char		rose_addr[5];
 } rose_address;
+#endif /* __UAPI_DEF_ROSE_ADDRESS */
 
+#if __UAPI_DEF_SOCKADDR_ROSE
 struct sockaddr_rose {
 	__kernel_sa_family_t srose_family;
 	rose_address	srose_addr;
@@ -53,7 +59,9 @@ struct sockaddr_rose {
 	int		srose_ndigis;
 	ax25_address	srose_digi;
 };
+#endif /* __UAPI_DEF_SOCKADDR_ROSE */
 
+#if __UAPI_DEF_FULL_SOCKADDR_ROSE
 struct full_sockaddr_rose {
 	__kernel_sa_family_t srose_family;
 	rose_address	srose_addr;
@@ -61,7 +69,9 @@ struct full_sockaddr_rose {
 	unsigned int	srose_ndigis;
 	ax25_address	srose_digis[ROSE_MAX_DIGIS];
 };
+#endif /* __UAPI_DEF_FULL_SOCKADDR_ROSE */
 
+#if __UAPI_DEF_ROSE_ROUTE_STRUCT
 struct rose_route_struct {
 	rose_address	address;
 	unsigned short	mask;
@@ -70,12 +80,16 @@ struct rose_route_struct {
 	unsigned char	ndigis;
 	ax25_address	digipeaters[AX25_MAX_DIGIS];
 };
+#endif /* __UAPI_DEF_ROSE_ROUTE_STRUCT */
 
+#if __UAPI_DEF_ROSE_CAUSE_STRUCT
 struct rose_cause_struct {
 	unsigned char	cause;
 	unsigned char	diagnostic;
 };
+#endif /* __UAPI_DEF_ROSE_CAUSE_STRUCT */
 
+#if __UAPI_DEF_ROSE_FACILITIES_STRUCT
 struct rose_facilities_struct {
 	rose_address	source_addr,   dest_addr;
 	ax25_address	source_call,   dest_call;
@@ -86,5 +100,6 @@ struct rose_facilities_struct {
 	rose_address	fail_addr;
 	ax25_address	fail_call;
 };
+#endif /* __UAPI_DEF_ROSE_FACILITIES_STRUCT */
 
 #endif
-- 
2.8.1

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

* [PATCH v05 72/72] uapi route.h: glibc net/route.h compat fix
       [not found] <1471890809-4383-1-git-send-email-mikko.rapeli@iki.fi>
                   ` (10 preceding siblings ...)
  2016-08-22 18:33 ` [PATCH v05 69/72] uapi rose.h: glibc netrose/rose.h " Mikko Rapeli
@ 2016-08-22 18:33 ` Mikko Rapeli
  11 siblings, 0 replies; 26+ messages in thread
From: Mikko Rapeli @ 2016-08-22 18:33 UTC (permalink / raw)
  To: linux-kernel; +Cc: Mikko Rapeli, David S. Miller, Nicolas Dichtel

Fixes this userspace compile error when net/route.h is included before
linux/route.h:

linux/route.h:30:8: error: redefinition of ‘struct rtentry’

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 include/uapi/linux/libc-compat.h | 10 ++++++++++
 include/uapi/linux/route.h       |  4 +++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/include/uapi/linux/libc-compat.h b/include/uapi/linux/libc-compat.h
index 07a3462..16ba7dc 100644
--- a/include/uapi/linux/libc-compat.h
+++ b/include/uapi/linux/libc-compat.h
@@ -230,6 +230,13 @@
 
 #endif /* defined(_NETROSE_ROSE_H) */
 
+/* Coordinate with glibc net/route.h */
+#if defined(_NET_ROUTE_H)
+#define __UAPI_DEF_RTENTRY		0
+#else /* defined(_NET_ROUTE_H) */
+#define __UAPI_DEF_RTENTRY		1
+#endif /* defined(_NET_ROUTE_H) */
+
 /* Coordinate with glibc pty.h */
 #if defined(_PTY_H)
 #define __UAPI_DEF_TERMIOS	0
@@ -369,6 +376,9 @@
 #define __UAPI_DEF_ROSE_CAUSE_STRUCT			1
 #define __UAPI_DEF_ROSE_FACILITIES_STRUCT		1
 
+/* Definitions for route.h */
+#define __UAPI_DEF_RTENTRY		1
+
 /* Definitions for time.h */
 #define __UAPI_DEF_TIMESPEC			1
 #define __UAPI_DEF_TIMEVAL			1
diff --git a/include/uapi/linux/route.h b/include/uapi/linux/route.h
index 6600708..7b77ef2 100644
--- a/include/uapi/linux/route.h
+++ b/include/uapi/linux/route.h
@@ -23,10 +23,12 @@
 #ifndef _LINUX_ROUTE_H
 #define _LINUX_ROUTE_H
 
+#include <linux/libc-compat.h>
 #include <linux/if.h>
 #include <linux/compiler.h>
 
 /* This structure gets passed by the SIOCADDRT and SIOCDELRT calls. */
+#if __UAPI_DEF_RTENTRY
 struct rtentry {
 	unsigned long	rt_pad1;
 	struct sockaddr	rt_dst;		/* target address		*/
@@ -45,7 +47,7 @@ struct rtentry {
 	unsigned long	rt_window;	/* Window clamping 		*/
 	unsigned short	rt_irtt;	/* Initial RTT			*/
 };
-
+#endif /* __UAPI_DEF_RTENTRY */
 
 #define	RTF_UP		0x0001		/* route usable		  	*/
 #define	RTF_GATEWAY	0x0002		/* destination is a gateway	*/
-- 
2.8.1

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

* Re: [PATCH v05 21/72] include/uapi/linux/if_pppox.h: include linux/if.h
  2016-08-22 18:32 ` [PATCH v05 21/72] include/uapi/linux/if_pppox.h: include linux/if.h Mikko Rapeli
@ 2016-08-22 19:37   ` Stephen Hemminger
  2016-08-22 23:26     ` David Miller
  2016-08-23  6:41     ` Mikko Rapeli
  2016-08-22 23:33   ` David Miller
  1 sibling, 2 replies; 26+ messages in thread
From: Stephen Hemminger @ 2016-08-22 19:37 UTC (permalink / raw)
  To: Mikko Rapeli; +Cc: linux-kernel, netdev

On Mon, 22 Aug 2016 20:32:38 +0200
Mikko Rapeli <mikko.rapeli@iki.fi> wrote:

> Fixes userspace compilation error:
> 
> error: ‘IFNAMSIZ’ undeclared here (not in a function)
> 
> Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
> ---
>  include/uapi/linux/if_pppox.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/include/uapi/linux/if_pppox.h b/include/uapi/linux/if_pppox.h
> index e128769..473c3c4 100644
> --- a/include/uapi/linux/if_pppox.h
> +++ b/include/uapi/linux/if_pppox.h
> @@ -21,6 +21,7 @@
>  #include <asm/byteorder.h>
>  
>  #include <linux/socket.h>
> +#include <linux/if.h>
>  #include <linux/if_ether.h>
>  #include <linux/if_pppol2tp.h>
>  

I went back to the first patch in LKML for this series.
It seems your goal is that every include file should be standalone,
i.e it must include every definition it uses.

I disagree with this premise. It just makes things harder to maintain with
no real gain for any existing program.  What is the motivation for all this
useless churn? Is there some silly style rule that should be fixed instead?

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

* Re: [PATCH v05 38/72] include/uapi/linux/openvswitch.h: use __u32 from linux/types.h
  2016-08-22 18:32   ` [PATCH v05 38/72] include/uapi/linux/openvswitch.h: use __u32 from linux/types.h Mikko Rapeli
@ 2016-08-22 19:39     ` Stephen Hemminger
  2016-08-22 23:27       ` David Miller
  2016-08-23  6:49       ` Mikko Rapeli
       [not found]     ` <1471890809-4383-39-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
  1 sibling, 2 replies; 26+ messages in thread
From: Stephen Hemminger @ 2016-08-22 19:39 UTC (permalink / raw)
  To: Mikko Rapeli; +Cc: linux-kernel, Pravin Shelar, netdev, dev

On Mon, 22 Aug 2016 20:32:55 +0200
Mikko Rapeli <mikko.rapeli@iki.fi> wrote:

> Fixes userspace compiler error:
> 
> error: unknown type name ‘uint32_t’
> 
> Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
> ---
>  include/uapi/linux/openvswitch.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/uapi/linux/openvswitch.h b/include/uapi/linux/openvswitch.h
> index d95a301..645499a 100644
> --- a/include/uapi/linux/openvswitch.h
> +++ b/include/uapi/linux/openvswitch.h
> @@ -632,8 +632,8 @@ enum ovs_hash_alg {
>   * @hash_basis: basis used for computing hash.
>   */
>  struct ovs_action_hash {
> -	uint32_t  hash_alg;     /* One of ovs_hash_alg. */
> -	uint32_t  hash_basis;
> +	__u32  hash_alg;     /* One of ovs_hash_alg. */
> +	__u32  hash_basis;
>  };
>  
>  /**

This is a a real issue, but being buried in a huge patch series of include
file stuff I don't think anyone would see it.

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

* Re: [PATCH v05 21/72] include/uapi/linux/if_pppox.h: include linux/if.h
  2016-08-22 19:37   ` Stephen Hemminger
@ 2016-08-22 23:26     ` David Miller
  2016-08-23  6:41     ` Mikko Rapeli
  1 sibling, 0 replies; 26+ messages in thread
From: David Miller @ 2016-08-22 23:26 UTC (permalink / raw)
  To: stephen; +Cc: mikko.rapeli, linux-kernel, netdev

From: Stephen Hemminger <stephen@networkplumber.org>
Date: Mon, 22 Aug 2016 12:37:45 -0700

> It seems your goal is that every include file should be standalone,
> i.e it must include every definition it uses.

I think this is absolutely mandatory Stephen.  If you include x.h
it should just work if you use the interfaces x.h defines.

No user should have to know about dependencies, that is exactly the
job of the header file itself.

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

* Re: [PATCH v05 38/72] include/uapi/linux/openvswitch.h: use __u32 from linux/types.h
  2016-08-22 19:39     ` Stephen Hemminger
@ 2016-08-22 23:27       ` David Miller
  2016-08-23  6:49       ` Mikko Rapeli
  1 sibling, 0 replies; 26+ messages in thread
From: David Miller @ 2016-08-22 23:27 UTC (permalink / raw)
  To: stephen-OTpzqLSitTUnbdJkjeBofR2eb7JE58TQ
  Cc: dev-yBygre7rU0TnMu66kgdUjQ, mikko.rapeli-X3B1VOXEql0,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	netdev-u79uwXL29TY76Z2rM5mHXA

From: Stephen Hemminger <stephen@networkplumber.org>
Date: Mon, 22 Aug 2016 12:39:38 -0700

> This is a a real issue, but being buried in a huge patch series of include
> file stuff I don't think anyone would see it.

It hit netdev and thus patchwork, therefore anyone watching networking
patches saw it.

I would not call it buried at all.
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

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

* Re: [PATCH v05 22/72] include/uapi/linux/if_tunnel.h: include linux/if.h, linux/ip.h and linux/in6.h
  2016-08-22 18:32 ` [PATCH v05 22/72] include/uapi/linux/if_tunnel.h: include linux/if.h, linux/ip.h and linux/in6.h Mikko Rapeli
@ 2016-08-22 23:28   ` David Miller
  0 siblings, 0 replies; 26+ messages in thread
From: David Miller @ 2016-08-22 23:28 UTC (permalink / raw)
  To: mikko.rapeli; +Cc: linux-kernel, stephen, philipp, netdev

From: Mikko Rapeli <mikko.rapeli@iki.fi>
Date: Mon, 22 Aug 2016 20:32:39 +0200

> Fixes userspace compilation errors like:
> 
> error: field ‘iph’ has incomplete type
> error: field ‘prefix’ has incomplete type
> 
> Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>

Applied.

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

* Re: [PATCH v05 41/72] include/uapi/linux/atm_zatm.h: include linux/time.h
  2016-08-22 18:32 ` [PATCH v05 41/72] include/uapi/linux/atm_zatm.h: include linux/time.h Mikko Rapeli
@ 2016-08-22 23:30   ` David Miller
  0 siblings, 0 replies; 26+ messages in thread
From: David Miller @ 2016-08-22 23:30 UTC (permalink / raw)
  To: mikko.rapeli; +Cc: linux-kernel, 3chas3, linux-atm-general, netdev

From: Mikko Rapeli <mikko.rapeli@iki.fi>
Date: Mon, 22 Aug 2016 20:32:58 +0200

> Fixes userspace compile error:
> 
> error: field ‘real’ has incomplete type
>  struct timeval real;  /* real (wall-clock) time */
> 
> Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>

Applied.

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

* Re: [PATCH v05 38/72] include/uapi/linux/openvswitch.h: use __u32 from linux/types.h
       [not found]     ` <1471890809-4383-39-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
@ 2016-08-22 23:31       ` David Miller
  0 siblings, 0 replies; 26+ messages in thread
From: David Miller @ 2016-08-22 23:31 UTC (permalink / raw)
  To: mikko.rapeli-X3B1VOXEql0
  Cc: dev-yBygre7rU0TnMu66kgdUjQ, netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

From: Mikko Rapeli <mikko.rapeli@iki.fi>
Date: Mon, 22 Aug 2016 20:32:55 +0200

> Fixes userspace compiler error:
> 
> error: unknown type name ‘uint32_t’
> 
> Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>

Applied.
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

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

* Re: [PATCH v05 25/72] include/uapi/linux/if_pppol2tp.h: include linux/in.h and linux/in6.h
  2016-08-22 18:32 ` [PATCH v05 25/72] include/uapi/linux/if_pppol2tp.h: include linux/in.h " Mikko Rapeli
@ 2016-08-22 23:31   ` David Miller
  0 siblings, 0 replies; 26+ messages in thread
From: David Miller @ 2016-08-22 23:31 UTC (permalink / raw)
  To: mikko.rapeli; +Cc: linux-kernel, jchapman, netdev

From: Mikko Rapeli <mikko.rapeli@iki.fi>
Date: Mon, 22 Aug 2016 20:32:42 +0200

> Fixes userspace compilation errors like:
> 
> error: field ‘addr’ has incomplete type
>  struct sockaddr_in addr; /* IP address and port to send to */
>                     ^
> error: field ‘addr’ has incomplete type
>  struct sockaddr_in6 addr; /* IP address and port to send to */
> 
> Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>

Applied.

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

* Re: [PATCH v05 26/72] include/uapi/linux/if_pppox.h: include linux/in.h and linux/in6.h
  2016-08-22 18:32 ` [PATCH v05 26/72] include/uapi/linux/if_pppox.h: " Mikko Rapeli
@ 2016-08-22 23:31   ` David Miller
  0 siblings, 0 replies; 26+ messages in thread
From: David Miller @ 2016-08-22 23:31 UTC (permalink / raw)
  To: mikko.rapeli; +Cc: linux-kernel, netdev

From: Mikko Rapeli <mikko.rapeli@iki.fi>
Date: Mon, 22 Aug 2016 20:32:43 +0200

> Fixes userspace compilation errors:
> 
> error: field ‘addr’ has incomplete type
>  struct sockaddr_in addr; /* IP address and port to send to */
> 
> error: field ‘addr’ has incomplete type
>  struct sockaddr_in6 addr; /* IP address and port to send to */
> 
> Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>

Applied.

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

* Re: [PATCH v05 62/72] include/uapi/linux/openvswitch.h: use __u32 from linux/types.h
       [not found]   ` <1471890809-4383-63-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
@ 2016-08-22 23:32     ` David Miller
  0 siblings, 0 replies; 26+ messages in thread
From: David Miller @ 2016-08-22 23:32 UTC (permalink / raw)
  To: mikko.rapeli-X3B1VOXEql0
  Cc: dev-yBygre7rU0TnMu66kgdUjQ, netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

From: Mikko Rapeli <mikko.rapeli@iki.fi>
Date: Mon, 22 Aug 2016 20:33:19 +0200

> Kernel uapi header are supposed to use them. Fixes userspace compile error:
> 
> linux/openvswitch.h:583:2: error: unknown type name ‘uint32_t’
> 
> Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>

Applied.
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

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

* Re: [PATCH v05 21/72] include/uapi/linux/if_pppox.h: include linux/if.h
  2016-08-22 18:32 ` [PATCH v05 21/72] include/uapi/linux/if_pppox.h: include linux/if.h Mikko Rapeli
  2016-08-22 19:37   ` Stephen Hemminger
@ 2016-08-22 23:33   ` David Miller
  1 sibling, 0 replies; 26+ messages in thread
From: David Miller @ 2016-08-22 23:33 UTC (permalink / raw)
  To: mikko.rapeli; +Cc: linux-kernel, netdev

From: Mikko Rapeli <mikko.rapeli@iki.fi>
Date: Mon, 22 Aug 2016 20:32:38 +0200

> Fixes userspace compilation error:
> 
> error: ‘IFNAMSIZ’ undeclared here (not in a function)
> 
> Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>

Applied.

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

* Re: [PATCH v05 64/72] include/uapi/linux/ipx.h: fix conflicting defitions with glibc netipx/ipx.h
  2016-08-22 18:33 ` [PATCH v05 64/72] include/uapi/linux/ipx.h: fix conflicting defitions with glibc netipx/ipx.h Mikko Rapeli
@ 2016-08-22 23:33   ` David Miller
  0 siblings, 0 replies; 26+ messages in thread
From: David Miller @ 2016-08-22 23:33 UTC (permalink / raw)
  To: mikko.rapeli; +Cc: linux-kernel, acme, nicolas.dichtel, netdev

From: Mikko Rapeli <mikko.rapeli@iki.fi>
Date: Mon, 22 Aug 2016 20:33:21 +0200

> Fixes these compiler warnings via libc-compat.h when glibc netipx/ipx.h is
> included before linux/ipx.h:
> 
> ./linux/ipx.h:9:8: error: redefinition of ‘struct sockaddr_ipx’
> ./linux/ipx.h:26:8: error: redefinition of ‘struct ipx_route_definition’
> ./linux/ipx.h:32:8: error: redefinition of ‘struct ipx_interface_definition’
> ./linux/ipx.h:49:8: error: redefinition of ‘struct ipx_config_data’
> ./linux/ipx.h:58:8: error: redefinition of ‘struct ipx_route_def’
> 
> Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>

Applied.

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

* Re: [PATCH v05 21/72] include/uapi/linux/if_pppox.h: include linux/if.h
  2016-08-22 19:37   ` Stephen Hemminger
  2016-08-22 23:26     ` David Miller
@ 2016-08-23  6:41     ` Mikko Rapeli
  1 sibling, 0 replies; 26+ messages in thread
From: Mikko Rapeli @ 2016-08-23  6:41 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: linux-kernel, netdev

On Mon, Aug 22, 2016 at 12:37:45PM -0700, Stephen Hemminger wrote:
> On Mon, 22 Aug 2016 20:32:38 +0200
> Mikko Rapeli <mikko.rapeli@iki.fi> wrote:
> 
> > Fixes userspace compilation error:
> > 
> > error: ‘IFNAMSIZ’ undeclared here (not in a function)
> > 
> > Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
> > ---
> >  include/uapi/linux/if_pppox.h | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/include/uapi/linux/if_pppox.h b/include/uapi/linux/if_pppox.h
> > index e128769..473c3c4 100644
> > --- a/include/uapi/linux/if_pppox.h
> > +++ b/include/uapi/linux/if_pppox.h
> > @@ -21,6 +21,7 @@
> >  #include <asm/byteorder.h>
> >  
> >  #include <linux/socket.h>
> > +#include <linux/if.h>
> >  #include <linux/if_ether.h>
> >  #include <linux/if_pppol2tp.h>
> >  
> 
> I went back to the first patch in LKML for this series.
> It seems your goal is that every include file should be standalone,
> i.e it must include every definition it uses.
> 
> I disagree with this premise. It just makes things harder to maintain with
> no real gain for any existing program.  What is the motivation for all this
> useless churn? Is there some silly style rule that should be fixed instead?

With over 700 uapi headers exported to userspace by Linux kernel, how
do I find out the 'correct' order of including them if they can not be
included alone? Any hints on automating that?

My first trial was to include all of the uapi headers as a single bunch to
abi checker tool which calls gcc on them, but the compilation result was
so bad and hopeless that I decided to try feeding each header file one by
one to the compiler and here I am over two years later still fixing these
issues.

I came up with the rule because to me it makes sense. Several kernel
devs agree with this approach and have accepted patches.

If your kernel subsystem uapi headers have a single entry point header file,
then all of the others can just depend on that and be done with it.
For example most (if not all) drm driver specific headers include <drm/drm.h>.

-Mikko

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

* Re: [PATCH v05 38/72] include/uapi/linux/openvswitch.h: use __u32 from linux/types.h
  2016-08-22 19:39     ` Stephen Hemminger
  2016-08-22 23:27       ` David Miller
@ 2016-08-23  6:49       ` Mikko Rapeli
  1 sibling, 0 replies; 26+ messages in thread
From: Mikko Rapeli @ 2016-08-23  6:49 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: dev-yBygre7rU0TnMu66kgdUjQ, netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

On Mon, Aug 22, 2016 at 12:39:38PM -0700, Stephen Hemminger wrote:
> On Mon, 22 Aug 2016 20:32:55 +0200
> Mikko Rapeli <mikko.rapeli@iki.fi> wrote:
> 
> > Fixes userspace compiler error:
> > 
> > error: unknown type name ‘uint32_t’
> > 
> > Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
> > ---
> >  include/uapi/linux/openvswitch.h | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/include/uapi/linux/openvswitch.h b/include/uapi/linux/openvswitch.h
> > index d95a301..645499a 100644
> > --- a/include/uapi/linux/openvswitch.h
> > +++ b/include/uapi/linux/openvswitch.h
> > @@ -632,8 +632,8 @@ enum ovs_hash_alg {
> >   * @hash_basis: basis used for computing hash.
> >   */
> >  struct ovs_action_hash {
> > -	uint32_t  hash_alg;     /* One of ovs_hash_alg. */
> > -	uint32_t  hash_basis;
> > +	__u32  hash_alg;     /* One of ovs_hash_alg. */
> > +	__u32  hash_basis;
> >  };
> >  
> >  /**
> 
> This is a a real issue, but being buried in a huge patch series of include
> file stuff I don't think anyone would see it.

The mechanism for finding this issue the same as finding a missing header file
dependency: the uapi header userspace compile test.

https://lkml.org/lkml/2016/8/22/659

I'm using "scripts/get_maintainers.pl --no-rolestats" to fill in the Cc: list
for git send-email so if MAINTAINERS is uptodate, then correct lists and
maintainers should have the received the patches.

-Mikko
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

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

end of thread, other threads:[~2016-08-23 20:56 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1471890809-4383-1-git-send-email-mikko.rapeli@iki.fi>
2016-08-22 18:32 ` [PATCH v05 21/72] include/uapi/linux/if_pppox.h: include linux/if.h Mikko Rapeli
2016-08-22 19:37   ` Stephen Hemminger
2016-08-22 23:26     ` David Miller
2016-08-23  6:41     ` Mikko Rapeli
2016-08-22 23:33   ` David Miller
2016-08-22 18:32 ` [PATCH v05 22/72] include/uapi/linux/if_tunnel.h: include linux/if.h, linux/ip.h and linux/in6.h Mikko Rapeli
2016-08-22 23:28   ` David Miller
2016-08-22 18:32 ` [PATCH v05 25/72] include/uapi/linux/if_pppol2tp.h: include linux/in.h " Mikko Rapeli
2016-08-22 23:31   ` David Miller
2016-08-22 18:32 ` [PATCH v05 26/72] include/uapi/linux/if_pppox.h: " Mikko Rapeli
2016-08-22 23:31   ` David Miller
     [not found] ` <1471890809-4383-1-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
2016-08-22 18:32   ` [PATCH v05 38/72] include/uapi/linux/openvswitch.h: use __u32 from linux/types.h Mikko Rapeli
2016-08-22 19:39     ` Stephen Hemminger
2016-08-22 23:27       ` David Miller
2016-08-23  6:49       ` Mikko Rapeli
     [not found]     ` <1471890809-4383-39-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
2016-08-22 23:31       ` David Miller
2016-08-22 18:32 ` [PATCH v05 41/72] include/uapi/linux/atm_zatm.h: include linux/time.h Mikko Rapeli
2016-08-22 23:30   ` David Miller
2016-08-22 18:33 ` [PATCH v05 62/72] include/uapi/linux/openvswitch.h: use __u32 from linux/types.h Mikko Rapeli
     [not found]   ` <1471890809-4383-63-git-send-email-mikko.rapeli-X3B1VOXEql0@public.gmane.org>
2016-08-22 23:32     ` David Miller
2016-08-22 18:33 ` [PATCH v05 64/72] include/uapi/linux/ipx.h: fix conflicting defitions with glibc netipx/ipx.h Mikko Rapeli
2016-08-22 23:33   ` David Miller
2016-08-22 18:33 ` [PATCH v05 66/72] uapi icmp.h: glibc netinet/ip_icmp.h header file compatibility fixes Mikko Rapeli
2016-08-22 18:33 ` [PATCH v05 68/72] uapi ax25.h: glibc netax25/ax25.h " Mikko Rapeli
2016-08-22 18:33 ` [PATCH v05 69/72] uapi rose.h: glibc netrose/rose.h " Mikko Rapeli
2016-08-22 18:33 ` [PATCH v05 72/72] uapi route.h: glibc net/route.h compat fix Mikko Rapeli

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).