Skip to contentSkip to conversation

doc: fix the compile fix of txtimestamp.c

PATCH Applied Willem de Bruijn 3 participants 3 messages Jan 10, 2015 – Jan 12, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 doc: fix the compile fix of txtimestamp.c

From: Willem de Bruijn <[email protected]>

A fix to ipv6 structure definitions removed the now superfluous definition of in6_pktinfo in this file.

But, use of the glibc definition requires defining _GNU_SOURCE (see also https://sourceware.org/bugzilla/show_bug.cgi?id=6775).

Before this change, the following would fail for me:

make
make headers_install
make M=Documentation/networking/timestamping

with

Documentation/networking/timestamping/txtimestamp.c: In function '__recv_errmsg_cmsg':
Documentation/networking/timestamping/txtimestamp.c:205:33: error: dereferencing pointer to incomplete type Documentation/networking/timestamping/txtimestamp.c:206:23: error: dereferencing pointer to incomplete type

After this patch compilation succeeded.

Fixes cd91cc5bdddf ("doc: fix the compile error of txtimestamp.c")

----

Due to the many libc headers included in txtimestamp.c, I was unable to make it compile cleanly by including the kernel header (linux/ipv6.h) first, as opposed to using the libc definition.

Btw, should we add the libc-compat.h directly to that file, as opposed to reading it indirectly through linux/in6.h?

include/uapi/linux/ipv6.h +1 -1
@@ -1,6 +1,7 @@
 #ifndef _UAPI_IPV6_H
 #define _UAPI_IPV6_H
 
+#include <linux/libc-compat.h>
 #include <linux/types.h>
---
 Documentation/networking/timestamping/txtimestamp.c | 2 ++
 1 file changed, 2 insertions(+)
Documentation/networking/timestamping/txtimestamp.c +2 -0
index 8778e68..05694fe 100644
@@ -30,6 +30,8 @@
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
+#define _GNU_SOURCE
+
 #include <arpa/inet.h>
 #include <asm/types.h>
 #include <error.h>
Signature · 1 line
2.2.0.rc0.207.ga3a616c
maintainer Applied
#1 lore raw

From: Willem de Bruijn <[email protected]>
Date: Sat, 10 Jan 2015 12:08:18 -0500

Quoted 16 lines

From: Willem de Bruijn <[email protected]>

A fix to ipv6 structure definitions removed the now superfluous definition of in6_pktinfo in this file.

But, use of the glibc definition requires defining _GNU_SOURCE (see also https://sourceware.org/bugzilla/show_bug.cgi?id=6775).

Before this change, the following would fail for me:

make
make headers_install
make M=Documentation/networking/timestamping

with

Quoted 8 lines

Documentation/networking/timestamping/txtimestamp.c: In function '__recv_errmsg_cmsg':
Documentation/networking/timestamping/txtimestamp.c:205:33: error: dereferencing pointer to incomplete type Documentation/networking/timestamping/txtimestamp.c:206:23: error: dereferencing pointer to incomplete type

After this patch compilation succeeded.

Fixes cd91cc5bdddf ("doc: fix the compile error of txtimestamp.c")

Applied, thanks.

#2 lore raw
In reply to Willem de Bruijn
Quoted 8 lines · Willem de Bruijn

Due to the many libc headers included in txtimestamp.c, I was unable to make it compile cleanly by including the kernel header (linux/ipv6.h) first, as opposed to using the libc definition.

Btw, should we add the libc-compat.h directly to that file, as opposed to reading it indirectly through linux/in6.h?

That seems fine.

Thanks for the fix!