netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch net-next] ipv6: fix redefinition of in6_pktinfo and ip6_mtuinfo
@ 2015-01-06 23:45 Cong Wang
  2015-01-06 23:45 ` [Patch net-next] doc: fix the compile error of txtimestamp.c Cong Wang
  2015-01-09  3:38 ` [Patch net-next] ipv6: fix redefinition of in6_pktinfo and ip6_mtuinfo David Miller
  0 siblings, 2 replies; 7+ messages in thread
From: Cong Wang @ 2015-01-06 23:45 UTC (permalink / raw)
  To: netdev; +Cc: carlos, vlee, davem, Cong Wang

Both netinet/in.h and linux/ipv6.h define these two structs,
if we include both of them, we got:

	/usr/include/linux/ipv6.h:19:8: error: redefinition of ‘struct in6_pktinfo’
	 struct in6_pktinfo {
		^
	In file included from /usr/include/arpa/inet.h:22:0,
			 from txtimestamp.c:33:
	/usr/include/netinet/in.h:524:8: note: originally defined here
	 struct in6_pktinfo
		^
	In file included from txtimestamp.c:40:0:
	/usr/include/linux/ipv6.h:24:8: error: redefinition of ‘struct ip6_mtuinfo’
	 struct ip6_mtuinfo {
		^
	In file included from /usr/include/arpa/inet.h:22:0,
			 from txtimestamp.c:33:
	/usr/include/netinet/in.h:531:8: note: originally defined here
	 struct ip6_mtuinfo
		^
So similarly to what we did for in6_addr, we need to sync with
libc header on their definitions.

Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
---
 include/uapi/linux/ipv6.h        | 5 ++++-
 include/uapi/linux/libc-compat.h | 6 ++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/include/uapi/linux/ipv6.h b/include/uapi/linux/ipv6.h
index e863d08..b9b1b7d 100644
--- a/include/uapi/linux/ipv6.h
+++ b/include/uapi/linux/ipv6.h
@@ -15,16 +15,19 @@
  *	*under construction*
  */
 
-
+#if __UAPI_DEF_IN6_PKTINFO
 struct in6_pktinfo {
 	struct in6_addr	ipi6_addr;
 	int		ipi6_ifindex;
 };
+#endif
 
+#if __UAPI_DEF_IP6_MTUINFO
 struct ip6_mtuinfo {
 	struct sockaddr_in6	ip6m_addr;
 	__u32			ip6m_mtu;
 };
+#endif
 
 struct in6_ifreq {
 	struct in6_addr	ifr6_addr;
diff --git a/include/uapi/linux/libc-compat.h b/include/uapi/linux/libc-compat.h
index e28807a..fa673e9 100644
--- a/include/uapi/linux/libc-compat.h
+++ b/include/uapi/linux/libc-compat.h
@@ -70,6 +70,8 @@
 #define __UAPI_DEF_IPV6_MREQ		0
 #define __UAPI_DEF_IPPROTO_V6		0
 #define __UAPI_DEF_IPV6_OPTIONS		0
+#define __UAPI_DEF_IN6_PKTINFO		0
+#define __UAPI_DEF_IP6_MTUINFO		0
 
 #else
 
@@ -84,6 +86,8 @@
 #define __UAPI_DEF_IPV6_MREQ		1
 #define __UAPI_DEF_IPPROTO_V6		1
 #define __UAPI_DEF_IPV6_OPTIONS		1
+#define __UAPI_DEF_IN6_PKTINFO		1
+#define __UAPI_DEF_IP6_MTUINFO		1
 
 #endif /* _NETINET_IN_H */
 
@@ -106,6 +110,8 @@
 #define __UAPI_DEF_IPV6_MREQ		1
 #define __UAPI_DEF_IPPROTO_V6		1
 #define __UAPI_DEF_IPV6_OPTIONS		1
+#define __UAPI_DEF_IN6_PKTINFO		1
+#define __UAPI_DEF_IP6_MTUINFO		1
 
 /* Definitions for xattr.h */
 #define __UAPI_DEF_XATTR		1
-- 
1.8.3.1

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

* [Patch net-next] doc: fix the compile error of txtimestamp.c
  2015-01-06 23:45 [Patch net-next] ipv6: fix redefinition of in6_pktinfo and ip6_mtuinfo Cong Wang
@ 2015-01-06 23:45 ` Cong Wang
  2015-01-09  3:38   ` David Miller
  2015-01-09  3:38 ` [Patch net-next] ipv6: fix redefinition of in6_pktinfo and ip6_mtuinfo David Miller
  1 sibling, 1 reply; 7+ messages in thread
From: Cong Wang @ 2015-01-06 23:45 UTC (permalink / raw)
  To: netdev; +Cc: carlos, vlee, davem, Cong Wang

Vinson reported:

  HOSTCC  Documentation/networking/timestamping/txtimestamp
Documentation/networking/timestamping/txtimestamp.c:64:8: error:
redefinition of ‘struct in6_pktinfo’
 struct in6_pktinfo {
        ^
In file included from /usr/include/arpa/inet.h:23:0,
                 from Documentation/networking/timestamping/txtimestamp.c:33:
/usr/include/netinet/in.h:456:8: note: originally defined here
 struct in6_pktinfo
        ^

After we sync with libc header, we don't need this ugly hack any more.

Reported-by: Vinson Lee <vlee@twopensource.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
---
 Documentation/networking/timestamping/txtimestamp.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/Documentation/networking/timestamping/txtimestamp.c b/Documentation/networking/timestamping/txtimestamp.c
index 876f71c..8778e68 100644
--- a/Documentation/networking/timestamping/txtimestamp.c
+++ b/Documentation/networking/timestamping/txtimestamp.c
@@ -59,14 +59,6 @@
 #include <time.h>
 #include <unistd.h>
 
-/* ugly hack to work around netinet/in.h and linux/ipv6.h conflicts */
-#ifndef in6_pktinfo
-struct in6_pktinfo {
-	struct in6_addr	ipi6_addr;
-	int		ipi6_ifindex;
-};
-#endif
-
 /* command line parameters */
 static int cfg_proto = SOCK_STREAM;
 static int cfg_ipproto = IPPROTO_TCP;
-- 
1.8.3.1

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

* Re: [Patch net-next] ipv6: fix redefinition of in6_pktinfo and ip6_mtuinfo
  2015-01-06 23:45 [Patch net-next] ipv6: fix redefinition of in6_pktinfo and ip6_mtuinfo Cong Wang
  2015-01-06 23:45 ` [Patch net-next] doc: fix the compile error of txtimestamp.c Cong Wang
@ 2015-01-09  3:38 ` David Miller
  2015-01-09 16:27   ` Carlos O'Donell
  2015-02-06  5:29   ` Carlos O'Donell
  1 sibling, 2 replies; 7+ messages in thread
From: David Miller @ 2015-01-09  3:38 UTC (permalink / raw)
  To: xiyou.wangcong; +Cc: netdev, carlos, vlee

From: Cong Wang <xiyou.wangcong@gmail.com>
Date: Tue,  6 Jan 2015 15:45:31 -0800

> Both netinet/in.h and linux/ipv6.h define these two structs,
> if we include both of them, we got:
> 
> 	/usr/include/linux/ipv6.h:19:8: error: redefinition of ‘struct in6_pktinfo’
> 	 struct in6_pktinfo {
> 		^
> 	In file included from /usr/include/arpa/inet.h:22:0,
> 			 from txtimestamp.c:33:
> 	/usr/include/netinet/in.h:524:8: note: originally defined here
> 	 struct in6_pktinfo
> 		^
> 	In file included from txtimestamp.c:40:0:
> 	/usr/include/linux/ipv6.h:24:8: error: redefinition of ‘struct ip6_mtuinfo’
> 	 struct ip6_mtuinfo {
> 		^
> 	In file included from /usr/include/arpa/inet.h:22:0,
> 			 from txtimestamp.c:33:
> 	/usr/include/netinet/in.h:531:8: note: originally defined here
> 	 struct ip6_mtuinfo
> 		^
> So similarly to what we did for in6_addr, we need to sync with
> libc header on their definitions.
> 
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>

Applied.

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

* Re: [Patch net-next] doc: fix the compile error of txtimestamp.c
  2015-01-06 23:45 ` [Patch net-next] doc: fix the compile error of txtimestamp.c Cong Wang
@ 2015-01-09  3:38   ` David Miller
  0 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2015-01-09  3:38 UTC (permalink / raw)
  To: xiyou.wangcong; +Cc: netdev, carlos, vlee

From: Cong Wang <xiyou.wangcong@gmail.com>
Date: Tue,  6 Jan 2015 15:45:32 -0800

> Vinson reported:
> 
>   HOSTCC  Documentation/networking/timestamping/txtimestamp
> Documentation/networking/timestamping/txtimestamp.c:64:8: error:
> redefinition of ‘struct in6_pktinfo’
>  struct in6_pktinfo {
>         ^
> In file included from /usr/include/arpa/inet.h:23:0,
>                  from Documentation/networking/timestamping/txtimestamp.c:33:
> /usr/include/netinet/in.h:456:8: note: originally defined here
>  struct in6_pktinfo
>         ^
> 
> After we sync with libc header, we don't need this ugly hack any more.
> 
> Reported-by: Vinson Lee <vlee@twopensource.com>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>

Applied.

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

* Re: [Patch net-next] ipv6: fix redefinition of in6_pktinfo and ip6_mtuinfo
  2015-01-09  3:38 ` [Patch net-next] ipv6: fix redefinition of in6_pktinfo and ip6_mtuinfo David Miller
@ 2015-01-09 16:27   ` Carlos O'Donell
  2015-02-06  5:29   ` Carlos O'Donell
  1 sibling, 0 replies; 7+ messages in thread
From: Carlos O'Donell @ 2015-01-09 16:27 UTC (permalink / raw)
  To: David Miller, xiyou.wangcong; +Cc: netdev, vlee

On 01/08/2015 10:38 PM, David Miller wrote:
> From: Cong Wang <xiyou.wangcong@gmail.com>
> Date: Tue,  6 Jan 2015 15:45:31 -0800
> 
>> Both netinet/in.h and linux/ipv6.h define these two structs,
>> if we include both of them, we got:
>>
>> 	/usr/include/linux/ipv6.h:19:8: error: redefinition of ‘struct in6_pktinfo’
>> 	 struct in6_pktinfo {
>> 		^
>> 	In file included from /usr/include/arpa/inet.h:22:0,
>> 			 from txtimestamp.c:33:
>> 	/usr/include/netinet/in.h:524:8: note: originally defined here
>> 	 struct in6_pktinfo
>> 		^
>> 	In file included from txtimestamp.c:40:0:
>> 	/usr/include/linux/ipv6.h:24:8: error: redefinition of ‘struct ip6_mtuinfo’
>> 	 struct ip6_mtuinfo {
>> 		^
>> 	In file included from /usr/include/arpa/inet.h:22:0,
>> 			 from txtimestamp.c:33:
>> 	/usr/include/netinet/in.h:531:8: note: originally defined here
>> 	 struct ip6_mtuinfo
>> 		^
>> So similarly to what we did for in6_addr, we need to sync with
>> libc header on their definitions.
>>
>> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
> 
> Applied.
> 

I'm reviewing the glibc side and will apply there if nobody has done so yet.

Cheers,
Carlos.

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

* Re: [Patch net-next] ipv6: fix redefinition of in6_pktinfo and ip6_mtuinfo
  2015-01-09  3:38 ` [Patch net-next] ipv6: fix redefinition of in6_pktinfo and ip6_mtuinfo David Miller
  2015-01-09 16:27   ` Carlos O'Donell
@ 2015-02-06  5:29   ` Carlos O'Donell
  2015-02-07  6:39     ` Cong Wang
  1 sibling, 1 reply; 7+ messages in thread
From: Carlos O'Donell @ 2015-02-06  5:29 UTC (permalink / raw)
  To: David Miller, xiyou.wangcong; +Cc: netdev, vlee

On 01/08/2015 10:38 PM, David Miller wrote:
> From: Cong Wang <xiyou.wangcong@gmail.com>
> Date: Tue,  6 Jan 2015 15:45:31 -0800
> 
>> Both netinet/in.h and linux/ipv6.h define these two structs,
>> if we include both of them, we got:
>>
>> 	/usr/include/linux/ipv6.h:19:8: error: redefinition of ‘struct in6_pktinfo’
>> 	 struct in6_pktinfo {
>> 		^
>> 	In file included from /usr/include/arpa/inet.h:22:0,
>> 			 from txtimestamp.c:33:
>> 	/usr/include/netinet/in.h:524:8: note: originally defined here
>> 	 struct in6_pktinfo
>> 		^
>> 	In file included from txtimestamp.c:40:0:
>> 	/usr/include/linux/ipv6.h:24:8: error: redefinition of ‘struct ip6_mtuinfo’
>> 	 struct ip6_mtuinfo {
>> 		^
>> 	In file included from /usr/include/arpa/inet.h:22:0,
>> 			 from txtimestamp.c:33:
>> 	/usr/include/netinet/in.h:531:8: note: originally defined here
>> 	 struct ip6_mtuinfo
>> 		^
>> So similarly to what we did for in6_addr, we need to sync with
>> libc header on their definitions.
>>
>> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
> 
> Applied.
> 

When does this hit mainline? I've got Cong's patch ready for glibc, but
the usual procedure is to commit after mainline has the matching patch.
Not that it really matters, but it's just a useful thing to be able to
say the trickle down is linux->glibc.

Cheers,
Carlos.

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

* Re: [Patch net-next] ipv6: fix redefinition of in6_pktinfo and ip6_mtuinfo
  2015-02-06  5:29   ` Carlos O'Donell
@ 2015-02-07  6:39     ` Cong Wang
  0 siblings, 0 replies; 7+ messages in thread
From: Cong Wang @ 2015-02-07  6:39 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: David Miller, Linux Kernel Network Developers, vlee

Hi, Carlos

On Thu, Feb 5, 2015 at 9:29 PM, Carlos O'Donell <carlos@redhat.com> wrote:
>
> When does this hit mainline? I've got Cong's patch ready for glibc, but
> the usual procedure is to commit after mainline has the matching patch.
> Not that it really matters, but it's just a useful thing to be able to
> say the trickle down is linux->glibc.
>

It will be merged in the next merge window, currently it is just in net-next.

Thanks.

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

end of thread, other threads:[~2015-02-07  6:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-06 23:45 [Patch net-next] ipv6: fix redefinition of in6_pktinfo and ip6_mtuinfo Cong Wang
2015-01-06 23:45 ` [Patch net-next] doc: fix the compile error of txtimestamp.c Cong Wang
2015-01-09  3:38   ` David Miller
2015-01-09  3:38 ` [Patch net-next] ipv6: fix redefinition of in6_pktinfo and ip6_mtuinfo David Miller
2015-01-09 16:27   ` Carlos O'Donell
2015-02-06  5:29   ` Carlos O'Donell
2015-02-07  6:39     ` Cong Wang

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