linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] netfilter: add include guard to xt_connlabel.h
@ 2019-07-28 15:51 Masahiro Yamada
  2019-07-29  0:08 ` Florian Westphal
  2019-07-29 13:15 ` Pablo Neira Ayuso
  0 siblings, 2 replies; 4+ messages in thread
From: Masahiro Yamada @ 2019-07-28 15:51 UTC (permalink / raw)
  To: Pablo Neira Ayuso, Jozsef Kadlecsik, Florian Westphal,
	netfilter-devel, coreteam
  Cc: Masahiro Yamada, linux-kernel

Add a header include guard just in case.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 include/uapi/linux/netfilter/xt_connlabel.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/uapi/linux/netfilter/xt_connlabel.h b/include/uapi/linux/netfilter/xt_connlabel.h
index 2312f0ec07b2..323f0dfc2a4e 100644
--- a/include/uapi/linux/netfilter/xt_connlabel.h
+++ b/include/uapi/linux/netfilter/xt_connlabel.h
@@ -1,4 +1,8 @@
 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
+
+#ifndef _UAPI_XT_CONNLABEL_H
+#define _UAPI_XT_CONNLABEL_H
+
 #include <linux/types.h>
 
 #define XT_CONNLABEL_MAXBIT 127
@@ -11,3 +15,5 @@ struct xt_connlabel_mtinfo {
 	__u16 bit;
 	__u16 options;
 };
+
+#endif /* _UAPI_XT_CONNLABEL_H */
-- 
2.17.1


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

* Re: [PATCH] netfilter: add include guard to xt_connlabel.h
  2019-07-28 15:51 [PATCH] netfilter: add include guard to xt_connlabel.h Masahiro Yamada
@ 2019-07-29  0:08 ` Florian Westphal
  2019-07-29 13:15 ` Pablo Neira Ayuso
  1 sibling, 0 replies; 4+ messages in thread
From: Florian Westphal @ 2019-07-29  0:08 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Pablo Neira Ayuso, Jozsef Kadlecsik, Florian Westphal,
	netfilter-devel, coreteam, linux-kernel

Masahiro Yamada <yamada.masahiro@socionext.com> wrote:
> Add a header include guard just in case.

Acked-by: Florian Westphal <fw@strlen.de>

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

* Re: [PATCH] netfilter: add include guard to xt_connlabel.h
  2019-07-28 15:51 [PATCH] netfilter: add include guard to xt_connlabel.h Masahiro Yamada
  2019-07-29  0:08 ` Florian Westphal
@ 2019-07-29 13:15 ` Pablo Neira Ayuso
  2019-07-29 14:07   ` Masahiro Yamada
  1 sibling, 1 reply; 4+ messages in thread
From: Pablo Neira Ayuso @ 2019-07-29 13:15 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Jozsef Kadlecsik, Florian Westphal, netfilter-devel, coreteam,
	linux-kernel

On Mon, Jul 29, 2019 at 12:51:38AM +0900, Masahiro Yamada wrote:
> Add a header include guard just in case.

Applied to nf.git, thanks.

BTW, is the _UAPI_ prefix really needed? I can see netfilter headers
under include/uapi/ sometimes are prefixed by UAPI and sometimes not.

Thanks.

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

* Re: [PATCH] netfilter: add include guard to xt_connlabel.h
  2019-07-29 13:15 ` Pablo Neira Ayuso
@ 2019-07-29 14:07   ` Masahiro Yamada
  0 siblings, 0 replies; 4+ messages in thread
From: Masahiro Yamada @ 2019-07-29 14:07 UTC (permalink / raw)
  To: Pablo Neira Ayuso
  Cc: Jozsef Kadlecsik, Florian Westphal,
	Netfilter Development Mailing list, coreteam,
	Linux Kernel Mailing List

On Mon, Jul 29, 2019 at 10:15 PM Pablo Neira Ayuso <pablo@netfilter.org> wrote:
>
> On Mon, Jul 29, 2019 at 12:51:38AM +0900, Masahiro Yamada wrote:
> > Add a header include guard just in case.
>
> Applied to nf.git, thanks.
>
> BTW, is the _UAPI_ prefix really needed? I can see netfilter headers
> under include/uapi/ sometimes are prefixed by UAPI and sometimes not.


The _UAPI prefix will be useful when you happen to
add the corresponding kernel-space header
since it is often the case to have the same name headers
for kernel-space and uapi.



For example, compare the include guards of the following.

include/linux/kernel.h
include/uapi/linux/kernel.h


Or, if you want to see an example for netfilter,

include/linux/netfilter/xt_hashlimit.h
include/uapi/linux/netfilter/xt_hashlimit.h



I recommend to add _UAPI prefix to headers
under include/uapi/
to avoid include guard conflict.

The _UAPI prefix is ripped off by
scripts/headers_install.sh
when exported to user-space.



-- 
Best Regards
Masahiro Yamada

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

end of thread, other threads:[~2019-07-29 14:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-28 15:51 [PATCH] netfilter: add include guard to xt_connlabel.h Masahiro Yamada
2019-07-29  0:08 ` Florian Westphal
2019-07-29 13:15 ` Pablo Neira Ayuso
2019-07-29 14:07   ` Masahiro Yamada

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