lkml.org 
[lkml]   [2019]   [Jul]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] netfilter: add include guard to xt_connlabel.h
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

\
 
 \ /
  Last update: 2019-07-29 16:09    [W:0.073 / U:0.840 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site