From: Willem de Bruijn <willemb@google.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, xiyou.wangcong@gmail.com,
vlee@twopensource.com, carlos@redhat.com,
Willem de Bruijn <willemb@google.com>
Subject: [PATCH net-next] doc: fix the compile fix of txtimestamp.c
Date: Sat, 10 Jan 2015 12:08:18 -0500 [thread overview]
Message-ID: <1420909698-25025-1-git-send-email-willemb@google.com> (raw)
From: Willem de Bruijn <willemb@google.com>
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")
Signed-off-by: Willem de Bruijn <willemb@google.com>
----
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?
--- a/include/uapi/linux/ipv6.h
+++ b/include/uapi/linux/ipv6.h
@@ -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(+)
diff --git a/Documentation/networking/timestamping/txtimestamp.c b/Documentation/networking/timestamping/txtimestamp.c
index 8778e68..05694fe 100644
--- a/Documentation/networking/timestamping/txtimestamp.c
+++ b/Documentation/networking/timestamping/txtimestamp.c
@@ -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>
--
2.2.0.rc0.207.ga3a616c
next reply other threads:[~2015-01-10 17:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-10 17:08 Willem de Bruijn [this message]
2015-01-12 2:56 ` [PATCH net-next] doc: fix the compile fix of txtimestamp.c David Miller
2015-01-12 5:43 ` Cong Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1420909698-25025-1-git-send-email-willemb@google.com \
--to=willemb@google.com \
--cc=carlos@redhat.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=vlee@twopensource.com \
--cc=xiyou.wangcong@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).