* [PATCH] uapi, seg6_iptunnel: Add missing include in seg6_iptunnel.h
@ 2020-07-29 10:49 Ioana-Ruxandra Stancioi
2020-07-29 19:50 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Ioana-Ruxandra Stancioi @ 2020-07-29 10:49 UTC (permalink / raw)
To: david.lebrun, davem, kuznet, yoshfuji, netdev, linux-kernel
Cc: elver, glider, Ioana-Ruxandra Stăncioi
From: Ioana-Ruxandra Stăncioi <stancioi@google.com>
Include <linux/ipv6.h> in uapi/linux/seg6_iptunnel.h to fix the
following linux/seg6_iptunnel.h compilation error:
invalid application of 'sizeof' to incomplete type 'struct ipv6hdr'
head = sizeof(struct ipv6hdr);
^~~~~~
This is to allow including this header in places where <linux/ipv6.h>
has not been included but __KERNEL__ is defined. In the kernel the easy
workaround is including <linux/ipv6.h>, but the header may also be used
by code analysis tools.
Signed-off-by: Ioana-Ruxandra Stăncioi <stancioi@google.com>
---
include/uapi/linux/seg6_iptunnel.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/uapi/linux/seg6_iptunnel.h b/include/uapi/linux/seg6_iptunnel.h
index 09fb608a35ec..b904228f463c 100644
--- a/include/uapi/linux/seg6_iptunnel.h
+++ b/include/uapi/linux/seg6_iptunnel.h
@@ -38,6 +38,7 @@ enum {
};
#ifdef __KERNEL__
+#include <linux/ipv6.h>
static inline size_t seg6_lwt_headroom(struct seg6_iptunnel_encap *tuninfo)
{
--
2.28.0.rc0.142.g3c755180ce-goog
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] uapi, seg6_iptunnel: Add missing include in seg6_iptunnel.h
2020-07-29 10:49 [PATCH] uapi, seg6_iptunnel: Add missing include in seg6_iptunnel.h Ioana-Ruxandra Stancioi
@ 2020-07-29 19:50 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-07-29 19:50 UTC (permalink / raw)
To: ioanaruxandra.stancioi
Cc: david.lebrun, kuznet, yoshfuji, netdev, linux-kernel, elver,
glider, stancioi
From: Ioana-Ruxandra Stancioi <ioanaruxandra.stancioi@gmail.com>
Date: Wed, 29 Jul 2020 10:49:03 +0000
> From: Ioana-Ruxandra Stăncioi <stancioi@google.com>
>
> Include <linux/ipv6.h> in uapi/linux/seg6_iptunnel.h to fix the
> following linux/seg6_iptunnel.h compilation error:
>
> invalid application of 'sizeof' to incomplete type 'struct ipv6hdr'
> head = sizeof(struct ipv6hdr);
> ^~~~~~
>
> This is to allow including this header in places where <linux/ipv6.h>
> has not been included but __KERNEL__ is defined. In the kernel the easy
> workaround is including <linux/ipv6.h>, but the header may also be used
> by code analysis tools.
>
> Signed-off-by: Ioana-Ruxandra Stăncioi <stancioi@google.com>
This doesn't belong in a UAPI header (it's __KERNEL__ protected after
all), and it's only called in one place in the kernel, namely
net/ipv6/net/ipv6/seg6_iptunnel.c)
Just move the helper to that foo.c file, and drop the inline keyword.
Thank you.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-07-29 19:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-29 10:49 [PATCH] uapi, seg6_iptunnel: Add missing include in seg6_iptunnel.h Ioana-Ruxandra Stancioi
2020-07-29 19:50 ` David Miller
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).